trace_plot¶
- trace_plot(posteriors: dict[str, ndarray]) None
It plots the traces and the probability density for each posterior.
The plot shows the traces for each Markov chain, for each regression variable and the relative posterior density. The plot layout has number of rows equal to the number of regression variables and two columns: traces on the left and densities on the right.
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.
Raises
TypeErrorIf
posteriorsis not adict,if a posterior sample is not a
numpy.ndarray.
KeyErrorIf
posteriorsdoes not contain'intercept'key.ValueErrorIf a posterior sample is an empty
numpy.ndarray.
See Also