Skip to contents

Geyer's initial positive sequence: sum autocorrelations in adjacent pairs and stop at the first non-positive pair sum. NOT the same quantity as morie_effective_sample_size in R/sampling.R, which is Kish's weights-based design effect; this one is about serial dependence in an ordered stream.

Usage

morie_ess_autocorrelation(x, max_lag = NULL)

Arguments

x

Ordered numeric sequence.

max_lag

Optional cap on the lag searched.

Value

A list with ess, tau_int, rho, n_lags_used.

References

Geyer CJ (1992) Statistical Science 7(4):473-483, doi:10.1214/ss/1177011137 .

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_ess_autocorrelation(V)
#> $ess
#> [1] 2.859574
#> 
#> $rho
#> [1]  1.0000000  0.6250000  0.2738095 -0.0297619 -0.2619048
#> 
#> $tau_int
#> [1] 2.797619
#> 
#> $n_lags_used
#> [1] 2
#>