An approximate calculation for the effective sample size for spatially autocorrelated data. Only valid for approximately normally distributed data.

n_eff(n, rho)

Source

Griffith, Daniel A. (2005). Effective geographic sample size in the presence of spatial autocorrelation. Annals of the Association of American Geographers. Vol. 95(4): 740-760.

Arguments

n

Number of observations.

rho

Spatial autocorrelation parameter from a simultaneous autoregressive model.

Value

Returns effective sample size n*, a numeric value.

Details

Implements Equation 3 from Griffith (2005).

See also

Examples


n_eff(100, 0)
n_eff(100, 0.5)
n_eff(100, 0.9)
n_eff(100, 1)

rho <- seq(0, 1, by = 0.01)
plot(rho, n_eff(100, rho),
     type = 'l',
     ylab = "Effective Sample Size")