Estimate lag-1 temporal autocorrelation
Source:R/detect_change.R
estimate_temporal_autocorrelation.RdEstimate the lag-1 autocorrelation rho_t of a leaf-wax record's
residuals after a flat-mean detrend, ordering by age. This is the
quantity that enters the within-record detection threshold from
manuscript Section 4.5.3 (Var(X1 - X2) = 2 sigma^2 (1 - rho_t)).
Usage
estimate_temporal_autocorrelation(
d2h_wax,
age,
method = c("ar1", "lomb_scargle")
)Value
Numeric scalar in [-1, 1], or NA_real_ when the residuals
are constant (e.g., n < 3 finite samples).
Details
Two methods are supported:
"ar1"(default): Pearson correlation ofresid[-n]withresid[-1]after age-ordering. For irregularly sampled series this is an approximation; see"lomb_scargle"for an alternative."lomb_scargle": not yet implemented. Returns an error pointing the user at"ar1"until the spectral implementation lands. The plan is to estimaterho_tfrom the dominant timescale of a Lomb-Scargle periodogram on the irregularly sampled series.