| Kinhom {spatstat} | R Documentation |
Estimates the inhomogeneous K function of a non-stationary point pattern.
Kinhom(X, lambda) Kinhom(X, lambda, r) Kinhom(X, lambda, breaks)
X |
The observed data point pattern,
from which an estimate of the inhomogeneous K function
will be computed.
An object of class "ppp"
or in a format recognised by as.ppp()
|
lambda |
Vector of values of the estimated intensity function,
evaluated at the points of the pattern X
|
r |
vector of values for the argument r at which the inhomogeneous K function should be evaluated. There is a sensible default. |
breaks |
An alternative to the argument r.
Not normally invoked by the user.
See Details.
This computes a generalisation of the K function for inhomogeneous point patterns, proposed by Baddeley, Moller and Waagepetersen (2000).
The ``ordinary'' K function
(variously known as the reduced second order moment function
and Ripley's K function), is
described under Kest. It is defined only
for stationary point processes.
The inhomogeneous K function Kinhom(r) is a direct generalisation to nonstationary point processes. Suppose x is a point process with non-constant intensity lambda(u) at each location u. Define Kinhom(r) to be the expected value, given that u is a point of x, of the sum of all terms 1/lambda(u)lambda(x[j]) over all points x[j] in the process separated from u by a distance less than r. This reduces to the ordinary K function if lambda() is constant. If x is an inhomogeneous Poisson process with intensity function lambda(u), then Kinhom(r) = pi * r^2.
This allows us to inspect a point pattern for evidence of interpoint interactions after allowing for spatial inhomogeneity of the pattern. Values Kinhom(r) > pi * r^2 are suggestive of clustering.
The argument lambda must be a vector of length equal to the
number of points in the pattern X. It will be interpreted as
giving the (estimated) values of lambda(x[i]) for
each point x[i] of the pattern x.
The pair correlation function can also be applied to the
result of Kinhom; see pcf.
A data frame containing
r |
the vector of values of the argument r at which the pair correlation function g(r) has been estimated |
K |
vector of values of Kinhom(r) |
theo |
vector of values of pi * r^2, the theoretical value of Kinhom(r) for an inhomogeneous Poisson process |
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
Baddeley, A., Moller, J. and Waagepetersen, R. (2000) Non- and semiparametric estimation of interaction in inhomogeneous point patterns. Statistica Neerlandica 54, 329350.
library(spatstat)
data(lansing)
# inhomogeneous pattern of maples
X <- unmark(lansing[lansing$marks == "maple",])
# fit spatial trend
fit <- mpl(X, ~ polynom(x,y,2), Poisson())
# predict intensity values at points themselves
lambda <- predict(fit, newdata=data.frame(x=X$x, y=X$y), type="trend")
# inhomogeneous K function
Ki <- Kinhom(X, lambda)
conspire(Ki, cbind(K, theo) ~ r, subset="r <= 0.4")
# SIMULATED DATA
# known intensity function
lamfun <- function(x,y) { 100 * x }
# inhomogeneous Poisson process
Y <- rpoispp(lamfun, 100, owin())
# evaluate intensity at points of pattern
lambda <- lamfun(Y$x, Y$y)
# inhomogeneous K function
Ki <- Kinhom(Y, lambda)
conspire(Ki, cbind(K, theo) ~ r, subset="r <= 0.2")