Last chance! 50% off unlimited learning
Sale ends in
Estimates the intensity of a point pattern
using the distance from each spatial location
to the k
th nearest data point.
nndensity(x, ...)# S3 method for ppp
nndensity(x, k, ..., verbose = TRUE)
A pixel image (object of class "im"
) giving the
estimated intensity of the point process at each spatial location.
Pixel values are intensities (number of points per unit area).
A point pattern (object of class "ppp"
)
or some other spatial object.
Integer. The distance to the k
th nearest data point
will be computed. There is a sensible default.
Arguments passed to nnmap
and as.mask
controlling the pixel resolution.
Logical. If TRUE
, print the value of k
when it is automatically selected. If FALSE
, remain silent.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Rolf Turner rolfturner@posteo.net.
This function computes a quick estimate of the intensity of the point
process that generated the point pattern x
.
For each spatial location x
.
If the data came from a homogeneous
Poisson process with intensity nndensity
,
apart from an edge effect correction.
See Cressie (1991, equation (8.5.14), p. 654) and Silverman (1986, p. 96).
This estimator of intensity is relatively fast to compute, and is spatially adaptive (so that it can handle wide variation in the intensity function). However, it implicitly assumes the points are independent, so it does not perform well if the pattern is strongly clustered or strongly inhibited.
In normal use, the value of k
should be at least 3.
(Theoretically the estimator has infinite expected value if k = 1
.)
The default value of k
is the square root of the number of
points in x
, which seems to work well in many cases.
The window of x
is digitised using as.mask
and the values nnmap
.
To control the pixel resolution, see as.mask
.
Cressie, N.A.C. (1991) Statistics for spatial data. John Wiley and Sons, New York.
Silverman, B.W. (1986) Density Estimation. Chapman and Hall, New York.
density.ppp
,
intensity
for alternative estimates of point process intensity.
plot(nndensity(swedishpines))
Run the code above in your browser using DataLab