pymc-bayesian-modeling

Build, fit, and validate Bayesian models with PyMC.

557|98|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/jimmc414/Kosmos --skill pymc-bayesian-modeling-jimmc414
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymc-bayesian-modeling
Source: https://github.com/jimmc414/Kosmos/tree/main/kosmos-claude-scientific-skills/scientific-skills/pymc
Command: npx skills add https://github.com/jimmc414/Kosmos --skill pymc-bayesian-modeling-jimmc414

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides a comprehensive toolkit for performing Bayesian statistical modeling and probabilistic programming using the PyMC library, enabling robust inference and uncertainty quantification.

Core Features & Use Cases

  • Bayesian Model Building: Construct complex hierarchical models, regression models (linear, logistic, Poisson), and time series models.
  • Inference & Diagnostics: Perform MCMC sampling (NUTS), variational inference, and conduct thorough diagnostic checks (R-hat, ESS, divergences).
  • Model Comparison & Validation: Compare models using LOO/WAIC and perform posterior predictive checks to validate model fit.
  • Use Case: Analyze experimental data with hierarchical structure to understand group-level variations and overall population trends, while quantifying uncertainty in all estimates.

Quick Start

Use the pymc-bayesian-modeling skill to build a Bayesian linear regression model for the provided dataset.

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 validate a Bayesian hierarchical model using PyMC?

Bayesian model comparison using LOO or WAIC evaluates predictive accuracy by estimating out-of-sample error. You fit candidate models with MCMC sampling, then apply these criteria to select the model with the best expected predictive performance.

What is the best way to quantify uncertainty in a Bayesian regression model?

The best way to quantify uncertainty in a Bayesian regression model is by computing the full posterior distribution. You use MCMC sampling or variational inference to capture credible intervals for all estimated parameters and predictions.

Can I perform variational inference and MCMC sampling for time series models?

Yes, you can perform variational inference and MCMC sampling for time series models. The framework supports constructing time series structures and fitting them using either NUTS sampling or variational inference algorithms.

Do I need pandas and numpy to run probabilistic programming models?

Yes, you need pandas and numpy to run probabilistic programming models because they are required dependencies. They handle data manipulation and numerical operations before and during the Bayesian inference process.

Why does my Bayesian inference show divergences during MCMC sampling?

Your Bayesian inference shows divergences during MCMC sampling when the sampler encounters regions of high curvature in the posterior. Diagnose this using built-in checks to inspect R-hat, effective sample sizes, and trace plots for validation.