autocorrelation_plot¶
- autocorrelation_plot(posteriors: dict[str, ndarray], max_lags: int = 30) None
It plots the auto-correlation for each Markov chain for each regression variable.
The plot shows the auto-correlation trend from lag
0(when auto-correlation is always1) up tomax_lags. The plot layout has number of rows equal to the number of regression variables and a number of columns equal to the number of chains.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.max_lagsint, optionalMaximum number of lags to which compute the auto-correlation. The default is
30.
Raises
TypeErrorIf
posteriorsis not adict,if a posterior sample is not a
numpy.ndarray,if
max_lagsis not anint.
KeyErrorIf
posteriorsdoes not contain'intercept'key.ValueErrorIf a posterior sample is an empty
numpy.ndarray,if
max_lagsis less or equal to0.