ipc.estK: Fit the (In)homogeneous Poisson Cluster Point Process by...

ipc.estKR 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 ppp format of spatstat.

lambda

Optional. Values of the estimated intensity function as a pixel image (object of class "im" of spatstat) giving the intensity values at all locations of mippp.

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 K(r) function.

r

Numeric vector. The values of the argument r at which the K(r) functions should be evaluated.

sigma2

Optional. Starting value for the parameter sigma2 of the Poisson Cluster process.

rho

Optional. Starting value for the parameter rho of the Poisson Cluster process.

q

q exponent of the contrast criterion (see mincontrast).

p

p exponent of the contrast criterion (see mincontrast).

x

An object of class 'ecespa.minconfit', resulting of applying ipc.estK to fit a Poisson Cluster Process.

type

Type of function to be ploted. If type="L", function L(r) [= sqrt(K(r)/pi)-r] is ploted. Otherwise, function K(r) is ploted.

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 link{plot}.

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 sigma^2.

rho

Parameter rho.

d.theta

Minimized value of the contrast criterion D(theta).

Kobs

Values of the observed K-function.

Kfit

Values of the fitted K-function.

r

Sequence of distances at which Kobs and Kfit have been estimated.

data

Original point pattern.

lambda

Original intensity function.

dataname

Name of the original point pattern.

lambdaname

Name of the original intensity function image.

q

q exponent of the contrast criterion.

p

p exponent of the contrast criterion.

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)



ecespa documentation built on Jan. 6, 2023, 1:21 a.m.

Related to ipc.estK in ecespa...