pymc

Specify Bayesian models in PyMC and fit them with MCMC or variational inference.

4|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/shushuzn/Rairos --skill pymc-shushuzn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc
Source: https://github.com/shushuzn/Rairos/tree/main/skills/pymc
Command: npx skills add https://github.com/shushuzn/Rairos --skill pymc-shushuzn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) and assets (resource) components.

What problem does it solve?

This Skill helps you build Bayesian probabilistic models that quantify uncertainty, validate assumptions with predictive checks, and compare competing models with trustworthy diagnostics.

Core Features & Use Cases

  • Hierarchical & multilevel modeling: model grouped data with non-centered parameterization to improve sampling stability.
  • Sampling and inference workflows: run MCMC with NUTS, use variational inference (ADVI) for fast approximations, and diagnose common issues like divergences and low effective sample size.
  • Model validation and comparison: perform prior/posterior predictive checks and compare models using LOO/WAIC with log-likelihood support.
  • Practical end-to-end templates: includes references and patterns for distributions, workflows, and reusable model templates (linear regression and hierarchical models) plus diagnostics and model-comparison scripts.
  • Use cases: Bayesian regression (linear/logistic/Poisson), uncertainty quantification, time series modeling, and principled handling of inference quality (R-hat, ESS, divergences, Pareto-k).

Quick Start

Use the pymc skill to build and validate a hierarchical Bayesian regression with prior predictive checks, NUTS sampling (with log_likelihood enabled), diagnostics, and a posterior predictive check for your dataset.

Frequently Asked Questions about pymc

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

FAQPage Schema
How do I build a hierarchical Bayesian model with PyMC?

Build hierarchical Bayesian models in PyMC by defining probabilistic distributions with named dimensions and using non-centered parameterization to improve MCMC sampling stability for grouped data.

How do I check convergence and diagnose MCMC sampling issues in Bayesian modeling?

Diagnose MCMC sampling issues in Bayesian modeling by checking R-hat, effective sample size (ESS), and divergences to ensure reliable posterior inference and convergence.

What is the best way to compare Bayesian models using LOO and WAIC?

Compare Bayesian models using LOO and WAIC by computing the log_likelihood for each model, then evaluating Pareto-k diagnostics to ensure the model comparison results are trustworthy.

Can I use variational inference for fast approximations in PyMC?

PyMC supports variational inference through ADVI, providing fast approximations for probabilistic models as an alternative to MCMC sampling when computational efficiency is prioritized.

How do I validate Bayesian model assumptions with posterior predictive checks?

Validate Bayesian model assumptions with posterior predictive checks by simulating data from the fitted model distribution and comparing it against observed data to evaluate model fit.

Why does my Bayesian regression model have low effective sample size and divergences?

Low effective sample size and divergences in Bayesian regression often indicate sampling issues; applying non-centered parameterization and checking prior choices can improve MCMC stability.