pcf(X, ..., method="c")smooth.spline."a", "b", "c" or "d" indicating the
method for deriving the pair correlation function from the
K function."fv", see fv.object)
representing a pair correlation function,
or a function array (object of class "fasp",
see fasp.object)
representing an array of pair correlation functions. If X is an unmarked point pattern, the return value is
a function value table (class "fv"). It is
essentially a data frame containing (at least) the variables
"fv") representing
the estimated $K$ function of a point pattern
(obtained from Kest, Kinhom
or Kest.fft),
then the return value is again a function value table,
representing the pair correlation function. If X is a multitype point pattern,
the return value is a function array (class "fasp").
This can be thought of as a matrix Y each of whose entries
Y[i,j] is a function value table (class "fv")
representing the pair correlation function between
points of type i and points of type j.
If X is a function array (class "fasp")
representing an array of estimated $K$ functions
(obtained from alltypes),
the return value is another function array, containing
the corresponding pair correlation functions.
Kest for information
about $K(r)$. For a stationary Poisson process, the
pair correlation function is identically equal to 1. Values
$g(r) < 1$ suggest inhibition between points;
values greater than 1 suggest clustering. We also apply the same definition to
other variants of the classical $K$ function,
such as the multitype $K$ functions
(see Kcross, Kdot) and the
inhomogeneous $K$ function (see Kinhom).
For all these variants, the benchmark value of
$K(r) = \pi r^2$ corresponds to
$g(r) = 1$.
This routine computes an estimate of $g(r)$ from an estimate of $K(r)$ or its variants, using smoothing splines to approximate the derivative.
The argument X may be either
"ppp",
or in a format recognised byas.ppp()."fv",
seefv.object).
This object should be the value returned byKest,Kcross,KmultiorKinhom."fasp",
seefasp.object)
containing several estimates of$K$functions.
This should have been obtained fromalltypeswith the argumentfun="K".X is a point pattern, the $K$ function is
first estimated by Kest.
The smoothing spline operations are performed by
smooth.spline and predict.smooth.spline
from the modreg library.
Four numerical methods are available:
"c" seems to be the best at
suppressing variability for small values of $r$.
However it effectively constrains $g(0) = 1$.
If the point pattern seems to have inhibition at small distances,
you may wish to experiment with method "b" which effectively
constrains $g(0)=0$. Method "a" seems
comparatively unreliable. Useful arguments to control the splines
include the smoothing tradeoff parameter spar
and the degrees of freedom df. See smooth.spline
for details.
Stoyan, D. and Stoyan, H. (1994) Fractals, random shapes and point fields: methods of geometrical statistics. John Wiley and Sons.
Kest,
Kinhom,
Kcross,
Kdot,
Kmulti,
alltypes,
smooth.spline,
predict.smooth.spline# univariate point pattern
data(simdat)
p <- pcf(simdat, spar=0.5, method="b")
plot(p, main="pair correlation function for simdat")
# indicates inhibition at distances r < 0.3
# multitype point pattern
data(betacells)
p <- pcf(alltypes(betacells, "K"), spar=0.5, method="b")
plot(p)
# short range inhibition between all types
# strong inhibition between "on" and "off"Run the code above in your browser using DataLab