
PyMC Bayesian Modeling
Builds, checks and compares Bayesian statistical models with PyMC, with diagnostics and reports.
- Repository
- K-Dense-AI/scientific-agent-skills
- Stars
- 55,780
- Licence
- MIT
- Files
- 10 files
What it does
It teaches the agent how to build Bayesian statistical models in PyMC, a Python library, following a careful workflow: define the question, set priors, run sampling, check convergence and predictive fit, then compare models. It includes ready-made templates for linear and hierarchical (multi-group) regression, plus helper scripts that check sampling diagnostics and compare models with PSIS-LOO. Results are reported with uncertainty rather than single numbers.
Great for
- Analysts or researchers who need probabilistic estimates with uncertainty from their own measurements
- Developers building hierarchical or multi-group models in PyMC 6.x
- Students learning Bayesian workflow who want checks (prior predictive, R-hat, ESS, LOO) done correctly
Skip it if
- Users who need a finished scientific conclusion: the skill states that short test runs are not evidence of converged estimates, and in-sample checks do not validate a model externally.
- Non-Python environments or older PyMC/ArviZ versions, since it targets PyMC 6.3.2, PyTensor 3.3.2 and ArviZ 1.3 specifically.
- Sensitive or regulated data handled without review: the agent will execute local Python code on whatever data you provide.
Try asking
- “Build a hierarchical regression of patient outcomes by clinic and check whether the model converged”
- “Compare a linear model against a robust Student-t model using PSIS-LOO and report which predicts better”
- “Predict an outcome for a new, unseen group with uncertainty that includes between-group variation”
- “Run a prior predictive check on my measurement model before fitting it”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 10 original files, the MIT licence and an attribution note.
pymc.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip pymc.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip pymc.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Tell the agent your data's units and the question you want answered so it can choose priors in outcome units and define the predictive target.
- Ask for the full diagnostics report (R-hat, ESS, divergences, BFMI) and for prior sensitivity checks, not just the point estimates.
- Run the bundled smoke commands first on synthetic data to confirm the environment works, then scale up draws and chains for a real analysis.
What's inside
- assets/hierarchical_model_template.py
- assets/linear_regression_template.py
- references/distributions.md
- references/model_patterns.md
- references/sampling_inference.md
- references/standard_workflow.md
- references/workflows.md
- scripts/model_comparison.py
- scripts/model_diagnostics.py
- SKILL.md
Redistributed unmodified from K-Dense-AI/scientific-agent-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.