Autocorrelation Analysis

A good heuristic for assessing convergence of samplings is the integrated autocorrelation time. emcee includes tools for computing this and the autocorrelation function itself. More details can be found in Autocorrelation analysis & convergence.

emcee.autocorr.integrated_time(x, c=5, tol=50, quiet=False)

Estimate the integrated autocorrelation time of a time series.

This estimate uses the iterative procedure described on page 16 of Sokal’s notes to determine a reasonable window size.

Parameters:
  • x – The time series. If multidimensional, set the time axis using the axis keyword argument and the function will be computed for every other axis.
  • c (Optional[float]) – The step size for the window search. (default: 5)
  • tol (Optional[float]) – The minimum number of autocorrelation times needed to trust the estimate. (default: 50)
  • quiet (Optional[bool]) – This argument controls the behavior when the chain is too short. If True, give a warning instead of raising an AutocorrError. (default: False)
Returns:

An estimate of the integrated autocorrelation time of

the time series x computed along the axis axis.

Return type:

float or array

Raises
AutocorrError: If the autocorrelation time can’t be reliably estimated
from the chain and quiet is False. This normally means that the chain is too short.
emcee.autocorr.function_1d(x)

Estimate the normalized autocorrelation function of a 1-D series

Parameters:x – The series as a 1-D numpy array.
Returns:The autocorrelation function of the time series.
Return type:array