Learn R Programming

geoCount (version 1.150120)

simData: Simulate Data Set from Generalized Linear Spatial Model on Given Locations

Description

This function simulates a data set on given locations for Poisson Log-normal spatial model or Binomial Logistic-normal spatial model.

Usage

simData(loc, L = 0, X = NULL, beta = 0, cov.par, rho.family = "rhoPowerExp", Y.family = "Poisson")

Arguments

loc
a $n \times 2$ matrix which indicates the coordinates of given locations
L
a vector of length n; it indicates the time duration during which the Poisson counts are accumulated, or the total number of trials for Binomial response; if 0 is found in the vector, 1 will be used to replace all the values in the vector
X
a $n \times p$ covariate matrix; the default value "NULL" indicates no covariate
beta
a vector of length $(p+1)$ that indicates the coefficients
cov.par
a vector of length 3 that indicates the value of $(\sigma,\phi,\kappa)$
rho.family
take the value of "rhoPowerExp", "rhoMatern", or "rhoSph" which indicates the powered exponential, Matern, or Spherical correlation function is used
Y.family
take the value of "Poisson" or "Binomial" which indicates Poisson or Binomial distribution for response variables

Value

A list with two elements:
data
a vector indicates the response variables
latent
a vector indicates the latent variables

Details

When using the powered exponential correlation function, note that $0

See Also

locCircle, locGrid, locSquad, simData, plotData.

Examples

Run this code
## Not run: 
#   loc <- rbind(locCircle(0.3, 10),
#                locCircle(0.6, 30),
#                locCircle(1.0, 50)
#                )
#   dat <- simData(loc, cov.par = c(1, 0.1, 1))
#   plotData(dat$data, loc)                  
# ## End(Not run)

Run the code above in your browser using DataLab