pymc

Build Bayesian models in PyMC with MCMC sampling and posterior inference.

783|65|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill pymc-leonchaox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc
Source: https://github.com/LeonChaoX/qinyan-academic-skills/tree/main/skills/09-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%B8%8E%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/pymc
Command: npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill pymc-leonchaox

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you build Bayesian statistical models and reliably estimate uncertainty instead of relying only on point estimates.

Core Features & Use Cases

  • Bayesian model building with hierarchical and multilevel structures using PyMC’s modern API.
  • Inference via MCMC (NUTS) and variational inference, including posterior predictive checks.
  • Model validation and comparison using LOO/WAIC and diagnostics for divergences, R-hat, and ESS.
  • Use Case: You have grouped experimental data (e.g., measurements from multiple labs or hospitals) and you want to estimate group-level effects while properly sharing strength across groups, then compare alternative models.

Quick Start

Ask the AI to fit a hierarchical Bayesian regression in PyMC for your grouped dataset, run prior and posterior predictive checks, and produce LOO/WAIC-based model comparison with convergence diagnostics.

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 regression model for grouped data in PyMC?

To build a hierarchical Bayesian regression in PyMC, define a model with priors and likelihood for grouped data, then sample using MCMC NUTS to estimate group-level effects while sharing strength across groups and quantifying uncertainty.

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

The best way to compare Bayesian models using LOO and WAIC in PyMC is to sample with log_likelihood enabled, then run model comparison functions to evaluate predictive accuracy and select the best fitting model for your dataset.

How do I run MCMC convergence diagnostics like R-hat and ESS for Bayesian inference?

To run MCMC convergence diagnostics for Bayesian inference, sample your PyMC model and check R-hat and effective sample size (ESS) metrics, alongside scanning for divergences, to validate that posterior chains have mixed properly.

Can I use variational inference instead of MCMC for Bayesian modeling in PyMC?

Yes, you can use variational inference instead of MCMC for Bayesian modeling in PyMC to achieve faster approximate posterior estimation, which also supports posterior predictive checks for validating model fit.

Why should I use posterior predictive checks after running Bayesian inference?

You should use posterior predictive checks after running Bayesian inference to validate model fit by comparing simulated draws against observed data, ensuring your PyMC model accurately captures the underlying data distribution.

When do I need Bayesian modeling with uncertainty quantification instead of point estimates?

You need Bayesian modeling with uncertainty quantification when working with grouped experimental data requiring hierarchical regression, where estimating full posterior distributions provides more reliable insights than relying on point estimates.