Learn R Programming

geostatsp (version 0.4.4)

simLgcp: Simulate a log-Gaussian Cox process

Description

Give covariates and model parameters, simulates a log-Gaussian Cox process

Usage

simLgcp(param, covariates=NULL, betas=NULL, 
	  rasterTemplate=covariates[[1]], model="whittle", ...)
	simPoissonPP(intensity)

Arguments

param
Model parameters for the latent Gaussian surface passed to GaussRF. For a Matern model, params should be a vector with elements mean, variance, scal
covariates
Either a raster stack or list of rasters and SpatialPolygonsDataFrames (with the latter having only a single data column).
betas
Coefficients for the covariates
rasterTemplate
Raster on which the latent surface is simulated, defaults to the first covariate.
model
model passed to GaussRF
...
additional arguments, see GaussRF in the RandomFields package.
intensity
Raster of the intensity of a Poisson point process.

Value

  • A list with a events element containing the event locations and a raster element containing a raster stack of the covariates, spatial random effect, and intensity.

Examples

Run this code
mymodel = c(mean=-0.5, variance=1, 
				scale=2, alpha=2)

myraster = raster(nrows=20,ncols=20,xmn=0,xmx=10,ymn=0,ymx=10)

myCovariate = list(a=raster(matrix(1:10,10,10), 0,10,0,10),
b=raster(matrix(1:10,10,10,byrow=TRUE), 0,10,0,10)) 

myLgcp=simLgcp(mymodel, myCovariate, betas=c(a=-0.1, b=0.25), 
	rasterTemplate=myraster)

plot(myLgcp$raster[["intensity"]])
points(myLgcp$events)

myIntensity = exp(-1+0.2*myCovariate[["a"]])
myPoissonPP = simPoissonPP(myIntensity)
plot(myIntensity)
points(myPoissonPP)

Run the code above in your browser using DataLab