pymc-bayesian-modeling

Build, fit, and evaluate Bayesian models with PyMC using MCMC sampling.

52|6|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ovachiever/droid-tings --skill pymc-bayesian-modeling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc-bayesian-modeling
Source: https://github.com/ovachiever/droid-tings/tree/main/skills/pymc
Command: npx skills add https://github.com/ovachiever/droid-tings --skill pymc-bayesian-modeling

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill introduces PyMC for Bayesian modeling and probabilistic programming. It enables building, fitting, validating, and comparing Bayesian models (linear, hierarchical, time series) with MCMC (NUTS) and variational inference, plus posterior checks and model comparison.

Core Features & Use Cases

  • End-to-end Bayesian workflow: Build priors, define likelihoods, sample posteriors, and validate with posterior predictive checks.
  • Model comparison & diagnostics: Use LOO/WAIC, R-hat, ESS, and divergences to select robust models.
  • Hierarchical modeling: Implement multilevel structures with non-centered parameterization for better convergence.

Quick Start

Run a simple Bayesian linear regression, check diagnostics, and compare two models using LOO.

Frequently Asked Questions about pymc-bayesian-modeling

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

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

Bayesian modeling with PyMC involves defining priors, specifying likelihoods, and sampling posteriors using MCMC (NUTS) or variational inference (ADVI). PyMC handles model construction, fitting, and generates posterior samples for inference and prediction on new data.

What diagnostics should I check after MCMC sampling?

Key diagnostics include R-hat (convergence), ESS (effective sample size), and divergences. PyMC and ArviZ compute these metrics to validate chain mixing and warn of sampling issues before relying on posterior estimates.

How do I compare Bayesian models and select the best one?

Model comparison uses leave-one-out (LOO) and WAIC criteria to evaluate predictive performance without overfitting. PyMC integrates with ArviZ to compute these metrics and rank candidate models by out-of-sample accuracy.

Can I build hierarchical models with PyMC?

Yes. PyMC supports multilevel structures with non-centered parameterization to improve convergence. Hierarchical models pool information across groups while estimating group-level and population-level parameters.

What types of data and problems does PyMC handle?

PyMC applies to linear regression, logistic regression, time-series, and count data. It handles any probabilistic model where you specify priors, likelihoods, and observed data—solving inference and uncertainty quantification for custom model structures.

How do posterior predictive checks validate my model?

Posterior predictive checks simulate new data from the fitted model and compare it to observed data to detect systematic discrepancies. This validates whether the model captures key patterns and assumptions in your data.