This session is concerned with summary statistics for interpoint correlation (i.e. dependence between points). The lecturer’s R script is available here (right click and save).
The swedishpines
dataset was recorded in a study plot in a large forest. We shall assume the pattern is stationary.
Calculate the estimate of the K-function using Kest
.
Plot the estimate of K(r) against r
Plot the estimate of K(r)−πr2 against r.
Calculate the estimate of the L-function and plot it against r.
Plot the estimate of L(r)−r against r.
Calculate and plot an estimate of the pair correlation function using pcf
.
Draw tentative conclusions from these plots about interpoint interaction in the data.
Generate Fry Plots for the Swedish Pines data using the two commands
fryplot(swedishpines)
fryplot(swedishpines, width=50)
What can you interpret from these plots?
The japanesepines
dataset is believed to exhibit spatial inhomogeneity. The question is whether, after allowing for inhomogeneity, there is still evidence of interpoint interaction. We will use the inhomogeneous K-function.
Compute the inhomogeneous K function using the default estimate of intensity (a leave-one-out kernel smoother) with heavy smoothing:
KiS <- Kinhom(japanesepines, sigma=0.1)
plot(KiS)
Fit a parametric trend to the data, and use this to compute the inhomogeneous K function:
fit <- ppm(japanesepines ~ polynom(x,y,2))
lambda <- predict(fit, type="trend")
KiP <- Kinhom(japanesepines, lambda)
plot(KiP)
Plot corresponding estimates of the inhomogeneous L function, using either Linhom
or
plot(KiS, sqrt(./pi) ~ r)
and similarly for KiP
.
Draw tentative conclusions about interpoint interaction.
To understand the difficulties with the K-function when the point pattern is not spatially homogeneous, try the following experiment.
Generate a simulated realisation of an inhomogeneous Poisson process, e.g.
X <- rpoispp(function(x,y){ 200 * exp(-3 * x) })
Plot the K-function or L-function. It will most likely appear to show evidence of clustering.
The cell process (rcell
) has the same theoretical K-function as the uniform Poisson process.
Read the help file
Generate a simulated realisation of the cell process with a 10x10 grid of cells and plot it.
Plot the K or L-function for this pattern, and determine whether it is distinguishable from a Poisson process.