Skip to contents

For each lag \(k = 1, \dots, order\) the units at shortest-path distance exactly \(k\) in the neighbour graph (spdep::nblag) are coded with style and a global statistic is computed, as spdep::sp.correlogram: Moran's I with expectation \(-1/(n-1)\) and its randomisation or normality variance (spdep::moran.test), Geary's C with expectation 1 (spdep::geary.test), or the Pearson correlation of x with its lag-k spatial lag. \(n\) in the moments counts units with a lag-k neighbour. The deviate is (estimate - expectation) / sqrt(variance) with a two-sided normal p-value.

Usage

SpatialCorrelogram(
  adjacency,
  x,
  order = 1L,
  method = "I",
  style = "W",
  randomisation = TRUE
)

Arguments

adjacency

Neighbour indicator matrix (nonzero = neighbour).

x

Numeric vector.

order

Largest lag order.

method

"I", "C" or "corr".

style

Weight coding "W", "B", "C" or "U".

randomisation

Randomisation (else normality) variance.

Value

List with estimate, expectation, variance, z, p_value (by lag; only estimate for "corr"), n_with_neighbours, method, style.

References

Cliff, A. D. and Ord, J. K. (1981). Spatial Processes: Models and Applications. Pion, London.

Examples

A <- 1 * (abs(outer(1:8, 1:8, "-")) == 1)
SpatialCorrelogram(A, c(1, 2, 3, 5, 4, 6, 8, 7), order = 2)$estimate
#> [1] 0.797619 0.250000