trace_plot

trace_plot(posteriors: dict) None

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

posteriorsdict

Posterior samples. Posteriors and relative samples are key-value pairs. Each sample is a numpy.ndarray with a number of rows equal to the number of iterations and a number of columns equal to the number of Markov chains.

Raises

TypeError
  • If posteriors is not a dict,

  • if a posterior sample is not a numpy.ndarray.

KeyError

If posteriors does not contain intercept key.

ValueError

If a posterior sample is an empty numpy.ndarray.

See Also

baypy.regression.linear_regression.LinearRegression