Learn R Programming

spatstat (version 1.23-1)

nncorr: Nearest-Neighbour Correlation Indices of Marked Point Pattern

Description

Computes nearest-neighbour correlation indices of a marked point pattern, including the nearest-neighbour mark product index (default case of nncorr), the nearest-neighbour mark index (nnmean), and the nearest-neighbour variogram index (nnvario).

Usage

nncorr(X,
            f = function(m1, m2) { m1 * m2 },
            ...,
            use = "all.obs", method = c("pearson", "kendall", "spearman"))
     nnmean(X)
     nnvario(X)

Arguments

X
The observed point pattern. An object of class "ppp".
f
Function $f$ used in the definition of the nearest neighbour correlation.
...
Extra arguments passed to f.
use,method
Arguments passed to the standard correlation function cor.

Value

  • Labelled vector of length 2 or 3 containing the unnormalised and normalised nearest neighbour correlations, and the classical correlation if appropriate.

Details

The nearest neighbour correlation index $\bar n_f$ of a marked point process $X$ is a number measuring the dependence between the mark of a typical point and the mark of its nearest neighbour.

The command nncorr computes the nearest neighbour correlation index based on any test function f provided by the user. The default behaviour of nncorr is to compute the nearest neighbour mark product index. The commands nnmean and nnvario are convenient abbreviations for other special choices of f.

In the default case, nncorr(X) computes three different versions of the nearest-neighbour correlation index: the unnormalised, normalised, and classical correlations. [object Object],[object Object],[object Object]

In the default case where f is not given, nncorr(X) computes the unnormalised and normalised versions of the nearest-neighbour product index $E[M \, M^\ast]$, and (if the marks are real numbers) the classical correlation between $M$ and $M^\ast$.

The wrapper functions nnmean and nnvario computes the correlation indices for two special choices of the function $f(m_1,m_2)$.

  • nnmeancomputes the correlation indices for$f(m_1,m_2) = m_1$. The unnormalised index is simply the mean value of the mark of the neighbour of a typical point,$E[M^\ast]$, while the normalised index is$E[M^\ast]/E[M]$, the ratio of the mean mark of the neighbour of a typical point to the mean mark of a typical point.
  • nnvariocomputes the correlation indices for$f(m_1,m_2) = (1/2) (m_1-m_2)^2$.

The argument X must be a point pattern (object of class "ppp") and must be a marked point pattern.

The argument f must be a function, accepting two arguments m1 and m2 which are vectors of equal length containing mark values (of the same type as the marks of X). It must return a vector of numeric values of the same length as m1 and m2. The values must be non-negative.

The arguments use and method control the calculation of the classical correlation using cor, as explained in the help file for cor.

Other arguments may be passed to f through the ... argument. This algorithm assumes that X can be treated as a realisation of a stationary (spatially homogeneous) random spatial point process in the plane, observed through a bounded window. The window (which is specified in X as X$window) may have arbitrary shape. Biases due to edge effects are treated using the border method edge correction.

References

Stoyan, D. and Stoyan, H. (1994) Fractals, random shapes and point fields: methods of geometrical statistics. John Wiley and Sons.

Examples

Run this code
data(finpines)
  nncorr(finpines)
  # heights of neighbouring trees are slightly negatively correlated

  data(amacrine)
  nncorr(amacrine, function(m1, m2) { m1 == m2})
  # neighbouring cells are usually of different type

Run the code above in your browser using DataLab