pymc

Build and infer Bayesian models with PyMC using MCMC and variational inference.

94|11|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/swaruplab/operon --skill pymc-swaruplab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc
Source: https://github.com/swaruplab/operon/tree/main/src-tauri/protocols/pymc
Command: npx skills add https://github.com/swaruplab/operon --skill pymc-swaruplab

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?

PyMC enables practitioners to build and infer probabilistic Bayesian models from data, enabling principled uncertainty quantification.

Core Features & Use Cases

  • Supports hierarchical/multilevel models, MCMC with NUTS, and variational inference for scalable Bayesian analyses.
  • Provides posterior predictive checks and model comparison tools (LOO/WAIC) via ArviZ for validated inference.
  • Real-world scenario: model patient outcomes with group effects and time-varying covariates to quantify uncertainty and inform decisions.

Quick Start

Define a simple PyMC model, run the sampler, and inspect the posterior.

Frequently Asked Questions about pymc

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

FAQPage Schema
How do I build hierarchical Bayesian models with PyMC for group effects?

Build hierarchical Bayesian models in PyMC by defining group-level priors and linking them to individual observations. This captures varying effects across groups and quantifies uncertainty in multilevel data structures using MCMC sampling.

What is the best way to diagnose MCMC convergence and perform posterior predictive checks?

Diagnose MCMC convergence and perform posterior predictive checks using ArviZ. It provides trace plots, R-hat statistics, and posterior predictive checks to validate Bayesian inference and ensure sampler reliability.

Can I use variational inference for scalable Bayesian analysis instead of MCMC?

Yes, you can use variational inference for scalable Bayesian analysis as an alternative to MCMC. It approximates posterior distributions faster, making it suitable for larger datasets where traditional NUTS sampling is computationally expensive.

How do I compare Bayesian models using LOO or WAIC?

Compare Bayesian models using LOO or WAIC through ArviZ integration. These information criteria evaluate out-of-sample predictive accuracy, allowing you to select the best-fitting model among competing probabilistic frameworks.

Do I need NumPy and pandas to fit Bayesian models with PyMC?

Yes, you need NumPy and pandas to fit Bayesian models with PyMC. These standard scientific libraries handle data manipulation and array operations required for defining model likelihoods and preparing input data structures.

When should I not use Bayesian inference for uncertainty quantification?

Avoid Bayesian inference when you need point estimates without uncertainty bounds, face severe computational constraints, or lack prior distribution information. Frequentist methods may be more efficient for simple, large-scale data analysis workflows.