library(spatstat)
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
.
The estimation is done with:
K <- Kest(swedishpines)
Plot the estimate of \(K(r)\) against \(r\)
To plot the K-function, we do:
plot(K, main = "K-function")
Plot the estimate of \(K(r) -
\pi\!r^2\) against \(r\) (Hint:
look at the fmla
argument in plot.fv
).
The estimated K-function subtracted \(\pi\!r^2\) can be done via the
fmla
(formula) interface:
plot(K, . - pi*r^2 ~ r, main = "Normalized K-function",
legendpos = "bottomright")
Calculate and plot an estimate of the pair correlation function
using pcf
.
The pair-correlation is also compute straight-forwardly:
pcorf <- pcf(swedishpines)
plot(pcorf)
Draw tentative conclusions from these plots about interpoint interaction in the data.
Assuming a homogeneous point pattern, both the L- and K-function are less what is expected under the Poisson process the data. Thus they indicate a comparatively regular point pattern. Similarly, the pair-correlation function also suggests this.
The command rThomas
generates simulated realisations of
the Thomas model (‘modified Thomas cluster process’).
Read the help file.
See help("rThomas")
.
Type plot(rThomas(10, 0.05, 8))
a few times, and
interpret the results.
replicate(3, plot(rThomas(10, 0.05, 8), main = ""))