PyMC Bayesian Modeling
An end-to-end PyMC skill covering hierarchical model building, NUTS sampling, convergence diagnostics, and LOO/WAIC model comparison.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
Makes Claude run Bayesian analyses in PyMC following a disciplined, standard workflow.
- Eight-step workflow: data prep → model building → prior predictive check → sampling → diagnostics (R-hat, ESS, divergences) → posterior predictive check → analysis → prediction. It explicitly discourages "sample first, check later".
- Distribution selection guide: recommended priors for scale, positive, probability, and correlation-matrix parameters (LKJ), plus likelihoods for continuous, count (Poisson, NegativeBinomial, ZeroInflated, Hurdle), binary, and categorical outcomes.
- Troubleshooting playbook: concrete fixes for divergences, low ESS, high R-hat, and slow sampling (non-centered parameterization, ADVI initialization, QR decomposition).
- Bundled assets:
model_diagnostics.pyfor automated trace/rank/energy report generation,model_comparison.pyfor PSIS-LOO comparison and model averaging, plus linear-regression and hierarchical model templates.
Who it's for
- Data scientists and researchers who need calibrated uncertainty, not point estimates
- Anyone modeling multilevel data (students within schools, sales within regions)
- PyMC/Stan users who want a repeatable diagnostics and model-comparison routine
Assumes working knowledge of Bayesian statistics to interpret results correctly.
Example uses
- Hierarchical regression: "Fit a hierarchical model for regional sales" → builds a non-centered model, runs a prior predictive check, samples 4 chains, and verifies zero divergences.
- Model comparison: "Is Poisson or NegativeBinomial better here?" → runs
compare_models()for ELPD ranking plus Pareto-k reliability checks. - Diagnostic debugging: "R-hat is 1.05, what now?" → walks through multimodality checks, longer tuning, and ADVI initialization.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/pymc folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pymc/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/sci-skills && mkdir -p ~/.claude/skills && cp -r /tmp/sci-skills/skills/pymc ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/pymc ~/.claude/skills/ - Set up Python. The doc suggests
uv pip install "pymc[nutpie]==6.0.1", but verify the current release first —pip install "pymc[nutpie]" arvizis the safer route. - Restart Claude Code and try a prompt like "build a hierarchical model in PyMC" to confirm the skill triggers.
- Copy the templates from
assets/into your project and run them as a smoke test.
View source on GitHub ↗License: MIT