Agent skill · research science · k-dense-ai

pymc

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 specific Bayesian modeling patterns and MCMC sampling techniques that the AI wouldn't reliably generate on its own.

What it needs

Requires pymc, python installed locally. About 6k tokens when loaded. Last updated 2026-08-03. 32,849 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 6.x+), including hierarchical models, MCMC sampling (NUTS), variational inference, posterior predictive checks, and model comparison (LOO, WAIC). Current Version and Setup PyMC 6.0.1 is the current stable release as of June 2026. It requires Python 3.12+, uses PyTensor 3 as the computational graph backend, and defaults to compiled backends such as Numba. For reproducible local environments, pin the version: The nutpie extra enables the faster Rust/Numba NUTS implementation. If using NumPyro or BlackJAX, install those optional sampler dependencies in the same environment and pin them in the project lockfile. 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 Never sample first and check later. The eight-step workflow — documented with code in references/standardworkflow.md — is: 1. Data preparation — including standardizing predictors so priors are interpretable. 2. Model building — priors and likelihood in a pm.Model context. 3. Prior predictive check — confirm the priors imply plausible data before fitting. 4. Fit model — pm.sample() with an explicit seed. 5. Check diagnostics — R-hat, ESS, divergences. Divergences invalidate the fit; fix the model or reparameterize rather than raising targetaccept and hoping. 6. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills k-dense-ai/pymc

View the source on GitHub

Browse the @skills marketplace