pymc

Build and fit Bayesian models with PyMC using MCMC sampling.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/sagunkayastha/claude_skills_collection --skill pymc-sagunkayastha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc
Source: https://github.com/sagunkayastha/claude_skills_collection/tree/main/machine-learning-ai/pymc
Command: npx skills add https://github.com/sagunkayastha/claude_skills_collection --skill pymc-sagunkayastha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymc, arviz, numpy, pandas, matplotlib, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill empowers users to build, fit, and validate sophisticated Bayesian statistical models, enabling robust probabilistic programming and inference for complex data analysis challenges.

Core Features & Use Cases

  • Bayesian Modeling: Construct hierarchical models, linear/logistic regressions, time series, and more.
  • Probabilistic Programming: Define models using PyMC's intuitive Python API.
  • Inference: Perform MCMC sampling (NUTS) and variational inference.
  • Model Validation: Conduct prior and posterior predictive checks, analyze diagnostics (R-hat, ESS, divergences).
  • Model Comparison: Evaluate and compare models using LOO/WAIC.
  • Use Case: Analyze clinical trial data with hierarchical models to account for patient grouping, quantify uncertainty in predictions, and compare different model specifications.

Quick Start

Use the pymc skill to build a Bayesian linear regression model for the provided 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 Bayesian hierarchical model for grouped data?

Build a Bayesian hierarchical model by defining group-level parameters and priors using the PyMC Python API, then fit the model to grouped data using MCMC sampling to quantify uncertainty across different patient or category groupings.

What is the best way to validate MCMC sampling diagnostics for Bayesian inference?

Validate MCMC sampling diagnostics for Bayesian inference by analyzing R-hat, effective sample size (ESS), and divergences using ArviZ, ensuring model convergence and reliable posterior distributions before comparing model specifications.

Can I compare Bayesian models using LOO and WAIC?

Compare Bayesian models using LOO and WAIC by computing information criteria on fitted PyMC models to evaluate out-of-sample predictive accuracy and select the best performing model specification.

Does PyMC support variational inference for large datasets?

PyMC supports variational inference as a faster alternative to MCMC sampling for large datasets, approximating posterior distributions when full Markov chain Monte Carlo sampling becomes computationally prohibitive.

How do I perform prior and posterior predictive checks for probabilistic programming?

Perform prior and posterior predictive checks for probabilistic programming by simulating data from defined distributions and fitted models, validating that model assumptions and posterior predictions align with observed data.

Can I use numpy and pandas data for Bayesian regression analysis?

Use numpy arrays and pandas DataFrames directly for Bayesian regression analysis in PyMC, passing structured data into probabilistic models to perform linear or logistic regression and quantify prediction uncertainty.