rLGCP {spatstat} | R Documentation |
Generate a random point pattern, a realisation of the log-Gaussian Cox process.
rLGCP(model="exponential", mu = 0, param = NULL, ..., win)
model |
character string: the name of a covariance model for
the Gaussian random field, as recognised by the function
|
mu |
mean function of the Gaussian random field. Either a
single number, a |
param |
Numeric vector of parameters for the covariance,
as understood by the function
|
... |
Further arguments passed to the function
|
win |
Window in which to simulate the pattern.
An object of class |
This function generates a realisation of a log-Gaussian Cox process (LGCP). This is a Cox point process in which the logarithm of the random intensity is a Gaussian random field with mean function μ and covariance function c(r). Conditional on the random intensity, the point process is a Poisson process with this intensity.
The arguments model
and param
specify the covariance
function of the Gaussian random field, in the format expected by the
RandomFields package. See
GaussRF
or
Covariance
for information about this format. A list of all implemented
models is available by typing PrintModelList()
.
This algorithm uses the function GaussRF
in the
RandomFields package to generate values of
a Gaussian random field, with the specified mean function mu
and the covariance specified by the arguments model
and
param
, on the points of a regular grid. The exponential
of this random field is taken as the intensity of a Poisson point
process, and a realisation of the Poisson process is then generated by the
function rpoispp
in the spatstat package.
If the simulation window win
is missing, then it defaults to
as.owin(mu)
if mu
is a pixel image,
and it defaults to the unit square otherwise.
The LGCP model can be fitted to data using kppm
.
The simulated point pattern (an object of class "ppp"
).
Additionally, the simulated intensity function is
returned as an attribute "Lambda"
.
Abdollah Jalilian and Rasmus Waagepetersen. Modified by Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
Moller, J., Syversveen, A. and Waagepetersen, R. (1998) Log Gaussian Cox Processes. Scandinavian Journal of Statistics 25, 451–482.
rpoispp
,
rMatClust
,
rGaussPoisson
,
rNeymanScott
,
lgcp.estK
,
kppm
if(require(RandomFields)) { # homogeneous LGCP with exponential covariance function X <- rLGCP("exp", 3, c(0, variance=0.2, nugget=0, scale=.1 )) # inhomogeneous LGCP with Gaussian covariance function m <- as.im(function(x, y){5 - 1.5 * (x - 0.5)^2 + 2 * (y - 0.5)^2}, W=owin()) X <- rLGCP("gauss", m, c(0, variance=0.15, nugget = 0, scale =0.5)) plot(attr(X, "Lambda")) points(X) # inhomogeneous LGCP with Matern covariance function X <- rLGCP("matern", function(x, y){ 1 - 0.4 * x}, c(0, variance=2, nugget=0, scale=0.7, a = 0.5), win = owin(c(0, 10), c(0, 10))) plot(X) } else message("Simulation requires the RandomFields package")