bayesian-workflow
Installation
SKILL.md
Bayesian Workflow
Workflow overview
Every Bayesian analysis follows this sequence. Do not skip steps -- especially model criticism.
- Formulate — Define the generative story. What underlying process, that we're precisely trying to model, created the data?
- Specify priors — See references/priors.md
- Implement in PyMC — Write the model. Prefer PyMC 5+ syntax. Use the latest version possible.
- Run prior predictive checks —
pm.sample_prior_predictive(). Verify priors produce plausible data ranges before fitting - Inference —
pm.sample(nuts_sampler="nutpie"). Always use nutpie for speed (the nutpie python package provides cutting-edge sampling). Don't hardcode the number of chains — let the sampler pick the best default for the platform. - Diagnose convergence — Use
arviz_stats.diagnose(idata)as the first check (requires arviz-stats >= 1.0.0). It covers R-hat, ESS, divergences, tree depth, and E-BFMI in one call. See references/diagnostics.md - Criticize the model — See references/model-criticism.md
- Check prior sensitivity — Run
psense_summary(idata)to verify conclusions are robust to prior choices. Visualize withplot_psense_dist(idata)fromarviz_plots. Requireslog_likelihoodandlog_priorin the InferenceData — compute them after sampling if needed. See references/sensitivity.md - Compare models (if applicable) — See references/model-comparison.md
- Report results — See references/reporting.md. When the user asks for a report or mentions a non-technical audience, generate a standalone markdown report file (not just code comments) using the template in reporting.md. Adapt the language to the audience — if they're new to Bayesian stats, include a glossary and plain-language explanations of key concepts.