rLGCP(model="exp", mu = 0, param = NULL, ..., win=NULL, saveLambda=TRUE)
"RM"
,
the code will search for a function of this name
in the function(x,y, ...)
or a pixel
image (object of class "im"
).var
and scale
.as.mask
to determine
the pixel resolution."owin"
.TRUE
(the default) then the
simulated random intensity will also be saved,
and returns as an attribute of the point pattern."ppp"
). Additionally, the simulated intensity function is
returned as an attribute "Lambda"
,
if saveLambda=TRUE
.
The string model
specifies the covariance
function of the Gaussian random field, and the parameters
of the covariance are determined by param
and ...
.
To determine the covariance model, the string model
is prefixed by "RM"
, and a function of this name is
sought in the RMmodel
in the
model="matern"
, corresponding
to the function RMmatern
in the
Standard variance parameters (for all functions beginning with
"RM"
in the var
for the variance at distance zero, and scale
for the scale
parameter. Other parameters are specified in the help files
for the individual functions beginning with "RM"
. For example
the help file for RMmatern
states that nu
is a parameter
for this model.
This algorithm uses the function RFsimulate
in the
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 win
is missing or NULL
,
then it defaults to
Window(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
.
# 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, var=0.15, 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}, var=2, scale=0.7, nu=0.5, win = owin(c(0, 10), c(0, 10))) plot(X) } else message("Simulation requires the RandomFields package")
rpoispp
,
rMatClust
,
rGaussPoisson
,
rNeymanScott
,
lgcp.estK
,
kppm