PanelRegression.plot#
- PanelRegression.plot(*, group='posterior', hdi_prob=0.94, show=True, legend_kwargs=None)[source]#
Plot the panel regression coefficients.
Bayesian models render a forest plot with HDI intervals; OLS models render a bar plot of point estimates. To plot only a subset of coefficients (or to customise the figure size), call
plot_coefficients()directly.- Parameters:
group (
Literal['prior','posterior']) – Draw group to render."posterior"(default) plots coefficient draws afterfit();"prior"plots the coefficient draws implied by the prior phase and requiressample_prior_predictive()first — on backends without a prior phase that call raisesPriorPredictiveNotSupportedException.hdi_prob (
float) – Probability mass of the highest density interval drawn around each posterior coefficient. Must be in(0, 1]. Ignored for OLS models. Defaults toHDI_PROB(currently 0.94).show (
bool) – Whether to automatically display the plot. Defaults toTrue.legend_kwargs (
dict[str,Any] |None) – Keyword arguments to adjust legend placement and styling. Supported keys:loc,bbox_to_anchor,fontsize,frameon,title(bbox_transformis accepted alongsidebbox_to_anchor). The existing legend is modified in place so that custom handles are preserved.
- Returns:
fig (matplotlib.figure.Figure) – The figure that was created.
ax (matplotlib.axes.Axes) – The axes object containing the coefficient plot.
- Return type: