simData: Simulate Data Set from Generalized Linear Spatial Model on...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

1
2
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 (σ,φ,κ)

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

Details

When using the powered exponential correlation function, note that 0<κ<=2.

Value

A list with two elements:

data

a vector indicates the response variables

latent

a vector indicates the latent variables

Author(s)

Liang Jing ljing918@gmail.com

See Also

locCircle, locGrid, locSquad, simData, plotData.

Examples

1
2
3
4
5
6
7
8
9
## 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)

geoCount documentation built on May 2, 2019, 12:38 a.m.

Related to simData in geoCount...