ipc.estK {ecespa} | R Documentation |
Fit the (In)homogeneous Poisson Cluster Point Process by Minimum Contrast
Description
Fits the (In)homogeneous Poisson Cluster point process to a point pattern dataset by the Method of Minimum Contrast.
Usage
ipc.estK(mippp, lambda = NULL, correction = "iso", r = NULL, sigma2 = NULL,
rho = NULL, q = 1/4, p = 2)
## S3 method for class 'ecespa.minconfit'
plot(x, type="L", add=FALSE, xlim=NULL, ylim=NULL, lwd=c(1,1),
lty=c(1,2), col=c(1,2), main=NULL, ...)
Arguments
mippp |
Point pattern to which the (I)PCP will be fitted. A point pattern with the |
lambda |
Optional. Values of the estimated intensity function as a pixel image (object of class " |
correction |
A character item selecting any of the options "border", "bord.modif", "isotropic", "Ripley" or
"translate". It specifies the edge correction(s) to be applied in the computation of the |
r |
Numeric vector. The values of the argument |
sigma2 |
Optional. Starting value for the parameter |
rho |
Optional. Starting value for the parameter |
q |
|
p |
|
x |
An object of class 'ecespa.minconfit', resulting of applying |
type |
Type of function to be ploted. If type="L", function |
add |
Logical. Should the curves be added to another plot? |
xlim |
Vector setting the limits of the x-axis. |
ylim |
Vector setting the limits of the y-axis. |
lwd |
Vector (length=2) setting the line width for ploting the two functions. |
lty |
Vector (length=2) setting the line type for ploting the two functions. |
col |
Vector (length=2) setting the line color for ploting the two functions. |
main |
Optional. Text to appear as a title of the plot. |
... |
Additional graphical parameters passed to |
Details
The algorithm fits the (inhomogeneous) Poisson cluster point process (PCP) to a point pattern, by finding the parameters of the (inhomogeneous) Poisson cluster model
which give the closest match between the theoretical K function of the Poisson cluster process and the observed
K function. For a concise explanation of the PCP see pc.estK
. For a more detailed explanation of the Method of Minimum Contrast, see mincontrast
in spatstat or Diggle (2003: 86).
The inhomogeneous PCP can be thought of as a thinned process of an homogeneous PCP, where the spatially varying thinning probability
f(s)
is related to the spatially varying intensity function lambda(s)
as f(s) = lambda(s)/max{lambda(s)}
(Waagepetersen, 2007).
As the inhomogeneous K function for the IPCP coincides with the (homogeneous) K function for the corresponding homogeneous PCP,
the parameters of the underlying homomgeneous PCP can be estimated as those that give the closest match between the theoretical K function
for the homogeneous PCP and the empirical inhomogeneous K function for the observed IPCP.
This Poisson cluster process can be simulated with rIPCP
.
Value
ipc.estK
gives an object of class 'ecespa.minconfit
', basically a list with the following components:
sigma2 |
Parameter |
rho |
Parameter |
d.theta |
Minimized value of the contrast criterion |
Kobs |
Values of the observed K-function. |
Kfit |
Values of the fitted K-function. |
r |
Sequence of distances at which |
data |
Original point pattern. |
lambda |
Original intensity function. |
dataname |
Name of the original point pattern. |
lambdaname |
Name of the original intensity function image. |
q |
|
p |
|
Author(s)
Marcelino de la Cruz Rot , inspired by some code of Philip M. Dixon
References
Diggle, P. J. 2003. Statistical analysis of spatial point patterns. Arnold, London.
Waagepetersen, R. P. 2007. An estimating function approach to inference for inhomogeneous Neymann-Scott processes. Biometrics 63: 252-258. doi:10.1111/j.1541-0420.2006.00667.x.
See Also
some functions in spatstat: mincontrast
for a more general implementation of the method of mimimum contrast;
matclust.estK
and lgcp.estK
fit other appropriate processes for clustered patterns.
Examples
#####################
## Same example as in pc.estK
data(gypsophylous)
# set the number of simulations (nsim=199 or larger for real analyses)
# and resolution for lambda (ngrid=200 or larger for real analyses)
nsim<- 19
ngrid <- 50
## Estimate K function ("Kobs").
gyps.env <- envelope(gypsophylous, Kest, correction="iso", nsim=nsim)
plot(gyps.env, sqrt(./pi)-r~r, legend=FALSE)
## Fit Poisson Cluster Process. The limits of integration
## rmin and rmax are setup to 0 and 60, respectively.
cosa.pc2 <- ipc.estK(gypsophylous, r = gyps.env$r[gyps.env$r<=60])
## Add fitted Kclust function to the plot.
plot(cosa.pc2, add=TRUE, lwd=c(3,3))
## A kind of pointwise test of the gypsophylous pattern been a realisation
## of the fitted model, simulating with rIPCP and using function J (Jest).
gyps.env.sim2 <- envelope(gypsophylous, Jest, nsim=nsim,
simulate=expression(rIPCP(cosa.pc2)))
plot(gyps.env.sim2, main="",legendpos="bottomleft")
## Not run:
#####################
## Inhomogeneous example
data(urkiola)
#####################
## univariate case
# get univariate pp
I.ppp <- split.ppp(urkiola)$birch
# estimate inhomogeneous intensity function
I.lam <- predict (ppm(I.ppp, ~polynom(x,y,2)), type="trend", ngrid=ngrid)
# Compute and plot envelopes to Kinhom, simulating from an Inhomogeneous
# Poisson Process:
I2.env <- envelope( I.ppp,Kinhom, lambda=I.lam, correction="trans",
nsim=nsim, simulate=expression(rpoispp(I.lam)))
plot(I2.env, sqrt(./pi)-r~r, xlab="r (metres)", ylab= "L (r)", col=c(1,3,2,2),legend=FALSE)
# It seems that there is short scale clustering; let's fit an Inhomogeneous
# Poisson Cluster Process:
I.ki <- ipc.estK(mippp=I.ppp, lambda=I.lam, correction="trans")
# Compute and plot envelopes to Kinhom, simulating from the fitted IPCP:
Ipc.env <- Ki(I.ki, correction="trans", nsim=nsim, ngrid=ngrid)
plot (Ipc.env, xlab="r (metres)", ylab= "L (r)")
#####################
## bivariate case: test independence between birch and quercus in Urkiola
J.ppp <- split.ppp(urkiola)$oak
# We want to simulate oak from a homogeneous Poisson model:
J.ppm <- ppm(J.ppp, trend=~1, interaction=Poisson() )
IJ.env <- Kci (mod1=I.ki, mod2=J.ppm, nsim=nsim)
plot(IJ.env, type=12)
plot(IJ.env, type=21)
## End(Not run)