
Effective sample size of an autocorrelated sequence
Source:R/abundance_text_voting_native.R
morie_ess_autocorrelation.RdGeyer'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.
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
#>