Learn R Programming

geostan (version 0.8.1)

n_eff: Effective sample size

Description

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

Usage

n_eff(n, rho)

Value

Returns effective sample size n*, a numeric value.

Arguments

n

Number of observations.

rho

Spatial autocorrelation parameter from a simultaneous autoregressive model.

Details

Implements Equation 3 from Griffith (2005).

See Also

sim_sar, aple

Examples

Run this code

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")

Run the code above in your browser using DataLab