ess_acf

utils.diagnostics.ess_acf(x, max_lag=None)

Effective sample size of a chain via initial-positive-sequence ACF.

n / (1 + 2 sum(paired positive autocorrelations)) with the sum truncated at the first negative pair (Geyer 1992). Returns n for white noise and shrinks toward 1 as the chain becomes sticky.

Parameters

Name Type Description Default
x np.ndarray The chain, shape (n,). required
max_lag int Truncate the autocorrelation sum at this lag. None

Returns

Name Type Description
float