rknn {spatstat.random} | R Documentation |
Theoretical Distribution of Nearest Neighbour Distance
Description
Density, distribution function, quantile function and random
generation for the random distance to the th nearest neighbour
in a Poisson point process in
dimensions.
Usage
dknn(x, k = 1, d = 2, lambda = 1)
pknn(q, k = 1, d = 2, lambda = 1)
qknn(p, k = 1, d = 2, lambda = 1)
rknn(n, k = 1, d = 2, lambda = 1)
Arguments
x , q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations to be generated. |
k |
order of neighbour. |
d |
dimension of space. |
lambda |
intensity of Poisson point process. |
Details
In a Poisson point process in -dimensional space, let
the random variable
be
the distance from a fixed point to the
-th nearest random point,
or the distance from a random point to the
-th nearest other random point.
Then has a Gamma distribution with shape parameter
and rate
where
is a constant (equal to the volume of the
unit ball in
-dimensional space).
See e.g. Cressie (1991, page 61).
These functions support calculation and simulation for the
distribution of .
Value
A numeric vector:
dknn
returns the probability density,
pknn
returns cumulative probabilities (distribution function),
qknn
returns quantiles,
and rknn
generates random deviates.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner rolfturner@posteo.net
References
Cressie, N.A.C. (1991) Statistics for spatial data. John Wiley and Sons, 1991.
Examples
x <- seq(0, 5, length=20)
densities <- dknn(x, k=3, d=2)
cdfvalues <- pknn(x, k=3, d=2)
randomvalues <- rknn(100, k=3, d=2)
deciles <- qknn((1:9)/10, k=3, d=2)