autocorrelation_summary¶
- autocorrelation_summary(posteriors: dict[str, ndarray], lags: Iterable[int] = None, print_summary: bool = True) DataFrame
It prints the auto-correlation summary for each regression variable.
The summary reports the auto-correlation values at the lags listed in
lags.Parameters¶
posteriorsdictPosterior samples. Posteriors and relative samples are key-value pairs. Each sample is a
numpy.ndarraywith a number of rows equal to the number of iterations and a number of columns equal to the number of Markov chains.lagsIterable, optionalList of the lags to which compute the auto-correlation. It cannot be an empty
Iterable. It must contain only positive integers. The default is[0, 1, 5, 10, 30].print_summarybool, optionalIf
Trueprints the autocorrelation summary report. Default isTrue.
Returns¶
pandas.DataFrameThe dataframe with a number of row equal to the number of element in
lagsand a number of columns equal to the number of model variables. Lags are reported in dataframe index.
Raises
TypeErrorIf
posteriorsis not adict,if a posterior sample is not a
numpy.ndarray,if
lagsis not anIterable,if
lagsdoes not contain onlyint,if
print_summaryis not abool.
KeyErrorIf
posteriorsdoes not contain'intercept'key.ValueErrorIf a posterior sample is an empty
numpy.ndarray,if
lagsis an emptyIterable,if a value in
lagsis a negativeint.
Notes
The reported auto-correlation for each variable is a mean of auto-correlations for the chains of that variable, for each chain.
See Also
autocorrelation_ploteffective_sample_size