pymc
Bayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.
Author
Category
Development ToolsInstall
Hot:5
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-pymc&locale=en&source=copy
PyMC Bayesian Modeling Skills
Skill Overview
PyMC provides a complete Bayesian modeling workflow to help you build probabilistic models with Python, perform MCMC sampling, run model diagnostics, and carry out predictive inference. It is suitable for uncertainty quantification in scientific research, data analysis, and machine learning.
Use Cases
Core Features
FAQs
What Python version and dependencies does PyMC require?
PyMC 6.0.1 requires Python 3.12 or higher and uses PyTensor 3 as the computational graph backend. It is recommended to install with
uv pip install "pymc[nutpie]==6.0.1". The nutpie extension provides a faster Rust/Numba NUTS implementation. If you need to use NumPyro or the BlackJAX sampler, you must install the compatible JAX dependencies separately.How can I resolve divergence issues in MCMC sampling?
Divergences are typically addressed with the following approaches: increase
target_accept to 0.95 or higher; use non-centered parameterization for hierarchical models; add stronger prior constraints to parameters; and check whether the model specification is incorrect. If the problem persists, you may need to reparameterize the model or use variational inference for initialization.How should I choose between LOO and WAIC for Bayesian model comparison?
LOO (leave-one-out cross-validation) is usually more accurate, but you should check Pareto-k values (reliable when k < 0.7). WAIC (Widely Applicable Information Criterion) is faster to compute and is suitable for large-scale model comparisons. When ΔLOO < 2 the models are similar—choose the simpler one. When ΔLOO > 10 there is strong evidence for the better model. For both, you must include
log_likelihood=True during fitting.