depictr.frequentist_bayesian_plot#
- depictr.frequentist_bayesian_plot(frequentist, bayesian, title=None)#
Overlay a frequentist estimate against a Bayesian posterior per term.
For each term the two sources share a row, offset slightly so they do not overlap. The frequentist side shows the point estimate with its confidence interval; the Bayesian side shows the posterior median with the inner 66% and outer 95% credible intervals. The sources are told apart by colour (brand blue for frequentist, accent orange for Bayesian).
Only terms present in both sources are drawn. The frequentist confidence level is whatever
depictr.models.tidy_estimates()reads from the model (95% for a fitted statsmodels result), matching the Bayesian outer band.- Parameters:
frequentist (statsmodels results object or pandas.DataFrame) – A fitted model or a tidy estimate frame, as accepted by
depictr.models.tidy_estimates().bayesian (pandas.DataFrame or dict of array-like) – Posterior draws, one column (or dict entry) per term, as accepted by
posterior_plot().title (str, optional) – Plot title.
- Return type:
plotnine.ggplot