Compute the estimated nearest neighbour type-equality function for a multitype point pattern dataset.
nnequal(X, ..., kmax = 20, ratio = TRUE, cumulative = TRUE)A function value table (object of class "fv") which can be
printed and plotted. The function has argument k (the order of
neighbour) and columns of values labelled bord (for the
border-correction estimate) and theo (for the theoretical value
expected under random labelling).
A multitype point pattern
(object of class "ppp" with marks that are a factor).
Maximum number of neighbours to be considered for each point.
Logical value indicating whether to compute the cumulative estimate. See Details.
Logical value indicating whether to save ratio information for future use in pooling data.
Ignored.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Lucia Cobo-Sanchez.
The nearest-neighbour type-equality function has two versions: cumulative and non-cumulative.
The non-cumulative version is a function
\(P(k)\) which gives, for each integer \(k\),
the probability that a typical point in the point pattern
will have the same type as its \(k\)-th neighbour.
For example \(P(5)=0.6\) would mean that there is a
60 percent chance that the fifth-nearest neighbour of a point
has the same type as the original point.
When cumulative=FALSE, the algorithm computes an estimate
of \(P(k)\) for each integer \(k\) up to kmax, and
returns the result as a function.
This is equivalent to
computing the nearest-neighbour correlation nncorr(X, k)
for each integer k from 1 to kmax.
The cumulative version is
\(Q(k) = \sum_{m=1}^k P(m)/k\).
This means that \(Q(k)\) is the average proportion,
amongst the nearest \(k\) neighbours of a point,
which share the same type as the original point.
For example \(Q(5)=0.6\) would mean that, on average,
three out of the first five nearest neighbours of a point
have the same type as the original point.
This function is computed when cumulative=TRUE (the default).
In either case, the result is a function value table (class "fv")
with two columns of values, one giving the estimate of
\(P(k)\) or \(Q(k)\), and the other giving the corresponding
average value for the pattern. Estimated values greater than the average
suggest that points of the same type are clustered together.
Diez-Martin, F., Cobo-Sanchez, L., Baddeley, A., Uribelarrea, D.,
Mabulla, A., Baquedano, E. and Dominguez-Rodrigo, M. (2021)
Tracing the spatial imprint of Oldowan technological behaviors: A view
from DS (Bed I, Olduvai Gorge, Tanzania).
PLOS ONE, Public Library of Science, 16, 1--47.
DOI: 10.1371/journal.pone.0254603
nncount
plot(nnequal(lansing), ylim=c(0, 0.5))
plot(envelope(amacrine, nnequal, nsim=19))
plot(envelope(amacrine, nnequal, cumulative=FALSE, nsim=19))
Run the code above in your browser using DataLab