autocorrelation_plot¶
- autocorrelation_plot(posteriors: dict, max_lags: int = 30) None
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¶
- posteriorsdict
Posterior 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, optional
Maximum number of lags to which compute the auto-correlation. The default is
30.
Raises¶
- TypeError
If
posteriorsis not adict,if a posterior sample is not a
numpy.ndarray,if
max_lagsis not aint.
- KeyError
If
posteriorsdoes not containinterceptkey.- ValueError
If a posterior sample is an empty
numpy.ndarray,if
max_lagsis less or equal to0.
See Also¶
baypy.diagnostics.functions.autocorrelation_summary()baypy.diagnostics.functions.effective_sample_size()