
rLGCP(model="exponential", mu = 0, param = NULL, ..., win)
GaussRF
in the
function(x,y, ...)
or a pixel
image (object of class "im"
).GaussRF
in the
GaussRF
in the
"owin"
."ppp"
). Additionally, the simulated intensity function is
returned as an attribute "Lambda"
.
The arguments model
and param
specify the covariance
function of the Gaussian random field, in the format expected by the
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
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, 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
.
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")
Run the code above in your browser using DataLab