bayesian-stats

Build Bayesian models with PyMC 5.x and ArviZ using NUTS sampling.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill bayesian-stats
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bayesian-stats
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/03-mathematics/bayesian-stats
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill bayesian-stats

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymc, arviz, numpy, pandas, matplotlib, scipy.

What problem does it solve?

Bayesian statistical inference turns uncertain parameters into full posterior distributions by combining prior beliefs with observed data, so you can quantify uncertainty and compare models without relying on single point estimates.

Core Features & Use Cases

  • Bayesian workflow end-to-end: prior selection and prior predictive checks, NUTS sampling in PyMC 5.x, and posterior predictive checks to validate fit.
  • Diagnostics you can act on: convergence checks using R-hat and effective sample size (ESS), plus divergence detection to flag problematic posteriors.
  • Model comparison and uncertainty-aware decisions: LOO-CV model comparison with ArviZ and hierarchical (multilevel) partial pooling; supports Bayesian A/B testing with direct probability statements.
  • Use case: You’re analyzing a metric with small sample sizes and suspected group effects (e.g., multiple stores or clinics) and you need an uncertainty-aware estimate plus a decision-ready comparison between candidate models.

Quick Start

Use this Skill to fit a Bayesian hierarchical regression to your grouped dataset using PyMC 5.x with NUTS sampling, verify convergence, run posterior predictive checks, and compare competing models via LOO-CV in ArviZ.

Frequently Asked Questions about bayesian-stats

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

FAQPage Schema
How do I perform Bayesian A/B testing with direct probability statements instead of p-values?

Bayesian A/B testing uses PyMC to sample posterior distributions, letting you make direct probability statements like the chance that variant A beats variant B. It replaces point estimates with uncertainty-aware conclusions from observed data.

What's the best way to run hierarchical modeling on grouped data with small sample sizes?

Hierarchical modeling with PyMC applies partial pooling to grouped data, borrowing strength across groups to stabilize estimates for small sample sizes. This provides uncertainty-aware estimates for suspected group effects like multiple stores or clinics.

How do I check MCMC sampling convergence using R-hat and effective sample size in PyMC?

Check MCMC sampling convergence by running NUTS sampling in PyMC and inspecting R-hat and effective sample size (ESS) diagnostics. These metrics, alongside divergence detection, flag problematic posteriors and validate that chains have mixed properly.

Can I use ArviZ for LOO-CV model comparison with PyMC posterior distributions?

Yes, you can use ArviZ for LOO-CV model comparison by computing the log_likelihood of your PyMC model. This generates leave-one-out cross-validation scores to evaluate and compare candidate models, yielding uncertainty-aware decision metrics.

Does PyMC 5.x support prior and posterior predictive checks for Bayesian inference?

PyMC 5.x supports the end-to-end Bayesian workflow including prior selection, prior predictive checks, NUTS sampling, and posterior predictive checks. These validations ensure your model's assumptions and fit align with the observed data.

How do I quantify uncertainty in regression parameters without relying on single point estimates?

Quantify uncertainty by building Bayesian statistical models that combine prior beliefs with observed data to produce full posterior distributions. This PyMC workflow replaces single point estimates with complete probability distributions for your parameters.