pymc-modeling

Guide Bayesian modeling with PyMC v5 and diagnose convergence using ArviZ.

16|2|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/pymc-labs/agent-skills --skill pymc-modeling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc-modeling
Source: https://github.com/pymc-labs/agent-skills/tree/main/skills/pymc-modeling
Command: npx skills add https://github.com/pymc-labs/agent-skills --skill pymc-modeling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill consolidates expert guidance for Bayesian modeling with PyMC v5+, enabling AI assistants to provide task-ready workflows, templates, and best practices rather than scattered references.

Core Features & Use Cases

  • Comprehensive workflow guidance for model specification, priors, inference (nutpie, PyMC NUTS, NumPyro/JAX backends), diagnostics, and model comparison.
  • Ready-to-use templates for core model families (Hierarchical/multilevel, GLMs, Gaussian processes, time series, BART, mixtures) and common patterns (coordinates/dims, non-centered parameterization, posterior predictive, and DO/observe causal inference).
  • Guidance on ArviZ workflows and diagnostic standards (r_hat, ess, divergences, LOO/WAIC) and best practices for reproducibility.
  • Real-world examples and short-form instructions that you can apply directly in your project today.

Quick Start

  • Install PyMC v5+ and dependencies; clone or copy this skill into your local skills folder; load it in your assistant environment.
  • Define a simple PyMC model (e.g., a linear regression with priors), run sampling, and inspect the inference data with ArviZ summaries.
  • Use recommended workflows to assess convergence and compare alternative models.

Frequently Asked Questions about pymc-modeling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define and run Bayesian inference models using PyMC?

To run Bayesian inference with PyMC, define your model with priors and likelihood, execute sampling using PyMC NUTS or nutpie backends, and inspect inference data with ArviZ diagnostics like r_hat and ess.

What is the best way to diagnose MCMC convergence and divergences in Bayesian modeling?

Diagnose MCMC convergence in Bayesian modeling by using ArviZ workflows to inspect r_hat, ess, and divergences, ensuring reliable posterior distributions and model reproducibility across your inference data.

Can I build hierarchical and Gaussian process models with PyMC v5+?

Yes, PyMC v5+ supports hierarchical models, Gaussian processes, time series, BART, and mixtures, providing ready-to-use templates and best-practice patterns like non-centered parameterization for complex model families.

How do I compare alternative Bayesian models using ArviZ?

Compare Bayesian models using ArviZ by evaluating information criteria like LOO and WAIC, which quantify predictive accuracy and help you select the best model specification for your data.

Does PyMC support causal inference and posterior predictive workflows?

PyMC supports causal inference patterns including DO/observe workflows, and provides templates for posterior predictive checks to validate your model's fit against observed data.

What backends can I use for MCMC sampling in PyMC besides the default NUTS?

Besides the default PyMC NUTS backend, you can run MCMC sampling using nutpie or NumPyro/JAX backends to accelerate Bayesian inference workflows depending on your computational environment.