Agent skill · research science · davila7
pymc-bayesian-modeling
Bayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.
Why this skill is useful
Provides domain-specific knowledge on Bayesian modeling techniques and practices that the AI wouldn't reliably generate on its own.
What it needs
Requires arviz, numpy, pymc installed locally. About 7k tokens when loaded. Last updated 2026-08-06. 30,138 stars on the source repository.
What this skill does
PyMC Bayesian Modeling Overview PyMC is a Python library for Bayesian modeling and probabilistic programming. Build, fit, validate, and compare Bayesian models using PyMC's modern API (version 5.x+), including hierarchical models, MCMC sampling (NUTS), variational inference, and model comparison (LOO, WAIC). When to Use This Skill This skill should be used when: Building Bayesian models (linear/logistic regression, hierarchical models, time series, etc.) Performing MCMC sampling or variational inference Conducting prior/posterior predictive checks Diagnosing sampling issues (divergences, convergence, ESS) Comparing multiple models using information criteria (LOO, WAIC) Implementing uncertainty quantification through Bayesian methods Working with hierarchical/multilevel data structures Handling missing data or measurement error in a principled way Standard Bayesian Workflow Follow this workflow for building and validating Bayesian models: 1. Data Preparation Key practices: Standardize continuous predictors (improves sampling efficiency) Center outcomes when possible Handle missing data explicitly (treat as parameters) Use named dimensions with coords for clarity 2. Model Building Key practices: Use weakly informative priors (not flat priors) Use HalfNormal or Exponential for scale parameters Use named dimensions (dims) instead of shape when possible Use pm.Data() for values that will be updated for predictions 3. Prior Predictive Check Always validate priors before fitting: Check: Do prior predictions span reasonable values? Are extreme values plausible given domain knowledge? If priors generate implausible data, adjust and re-check 4. Fit Model Key parameters: draws=2000: Number of samples per chain tune=1000: Warmup samples (discarded) chains=4: Run 4 chains for convergence checking targetaccept=0.9: Higher for difficult posteriors (0.95-0.99) Include loglikelihood=True for model comparison 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills davila7/pymc