Local pair correlation function

Computes individual contributions to the pair correlation function from each data point.

spatial, nonparametric
localpcf(X, ..., delta=NULL, rmax=NULL, nr=512, stoyan=0.15)
A point pattern (object of class "ppp").
Smoothing bandwidth. The halfwidth of the Epanechnikov kernel.
Optional. Maximum value of distance $r$ for which pair correlation values $g(r)$ should be computed.
Optional. Number of values of distance $r$ for which pair correlation $g(r)$ should be computed.
Optional. The value of the constant $c$ in Stoyan's rule of thumb for selecting the smoothing bandwidth delta.

localpcf computes the contribution, from each individual data point in a point pattern X, to the empirical pair correlation function of X. These contributions are sometimes known as LISA (local indicator of spatial association) functions based on pair correlation. Given a spatial point pattern X, the local pcf $g_i(r)$ associated with the $i$th point in X is computed by $$g_i(r) = \frac a {2 \pi n} \sum_j k(d_{i,j} - r)$$ where the sum is over all points $j \neq i$, $a$ is the area of the observation window, $n$ is the number of points in X, and $d_{ij}$ is the distance between points i and j. Here k is the Epanechnikov kernel, $$k(t) = \frac 3 { 4\delta} \max(0, 1 - \frac{t^2}{\delta^2}).$$ Edge correction is performed using the border method (for the sake of computational efficiency): the estimate $g_i(r)$ is set to NA if $r > b_i$, where $b_i$ is the distance from point $i$ to the boundary of the observation window.

The smoothing bandwidth $\delta$ may be specified. If not, it is chosen by Stoyan's rule of thumb $\delta = c/\hat\lambda$ where $\hat\lambda = n/a$ is the estimated intensity and $c$ is a constant, usually taken to be 0.15. The value of $c$ is controlled by the argument stoyan.


  • An object of class "fv", see fv.object, which can be plotted directly using plot.fv. Essentially a data frame containing columns
  • rthe vector of values of the argument $r$ at which the function $K$ has been estimated
  • theothe theoretical value $K(r) = \pi r^2$ or $L(r)=r$ for a stationary Poisson process
  • together with columns containing the values of the local pair correlation function for each point in the pattern. Column i corresponds to the ith point. The last two columns contain the r and theo values.

See Also

localK, pcf

  • localpcf
  X <- ponderosa

  g <- localpcf(X)
  plot(g, main="local pair correlation functions for ponderosa", legend=FALSE)

  # plot only the local pair correlation function for point number 7
  plot(g, est007 ~ r)
Documentation reproduced from package spatstat, version 1.21-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.