pymc
Skill by davila7
Guides Bayesian modeling in PyMC 5.x, covering hierarchical models, NUTS sampling, variational inference, posterior checks and LOO/WAIC model comparison. Aimed at users doing probabilistic programming and inference in Python.
Install pymc
Built from the published package, never by AI.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/scientific/pymc ~/.claude/skills/pymcRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/scientific/pymc ~/.gemini/antigravity-cli/skills/pymcAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill is a guide for Bayesian modeling with PyMC, a Python library for probabilistic programming. It follows the PyMC 5.x+ API and walks through a standard workflow: preparing data, building a model with priors and likelihoods, running prior predictive checks, fitting with MCMC sampling (NUTS), checking diagnostics such as R-hat, ESS and divergences, running posterior predictive checks, and making predictions. It also includes model patterns for linear, logistic, Poisson, hierarchical and autoregressive time series models.
The skill covers model comparison with LOO and WAIC, including delta-LOO interpretation, Pareto-k checks and model averaging. It presents variational inference with ADVI as a fast approximation for exploration or initialization. It is aimed at analysts and researchers who want to build and validate Bayesian models in Python.
Written from the project's SKILL.md and checked against it.
What it can do
- Bayesian workflowSteps from data preparation and model building through fitting, checking and predicting.
- Model patternsTemplates for linear, logistic, Poisson, hierarchical and AR time series models.
- Predictive checksPrior and posterior predictive checks to validate priors and model fit.
- MCMC with NUTSSampling guidance with settings for draws, tuning, chains and target acceptance.
- Variational inferenceFast ADVI approximation for exploration or sampler initialization.
- Convergence diagnosticsChecks for R-hat, ESS, divergences and trace plots, with suggested fixes.
- Model comparisonLOO and WAIC comparison with delta-LOO and Pareto-k interpretation.
- Model averagingAverages predictions across similar models using weights.
- Distribution guideSuggested priors and likelihoods for scale, count, binary and correlation parameters.
What you need
- Python
- PyMC 5.x or later
- ArviZ
Try asking
- Build a hierarchical model for grouped data and check it for divergences
- Compare three Bayesian models with LOO and explain the differences
- Run a prior predictive check before fitting my regression model
Good to know
- ADVI is an approximation and may underestimate uncertainty.
- Pareto-k values above 0.7 suggest LOO may be unreliable, so WAIC or k-fold CV is recommended.
- Some helper scripts and reference files named in the text are not included in the source shown.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: cli-tool/components/skills/scientific/pymc/SKILL.md, cli-tool/components/skills/scientific/pymc/assets/hierarchical_model_template.py, cli-tool/components/skills/scientific/pymc/assets/linear_regression_template.py, cli-tool/components/skills/scientific/pymc/scripts/model_comparison.py, cli-tool/components/skills/scientific/pymc/scripts/model_diagnostics.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md15 KB -
assets/hierarchical_model_template.py12 KB -
assets/linear_regression_template.py8 KB -
references/distributions.md11 KB -
references/sampling_inference.md10 KB
Show all 8 files
-
references/workflows.md14 KB -
scripts/model_comparison.py12 KB -
scripts/model_diagnostics.py11 KB
Alternatives to pymc
All alternatives →Guides an assistant through the Kaggle CLI, covering competitions, datasets, notebooks, models, benchmarks, authentication and quota. It is for people who use the kaggle command-line tool.
Generates Python code that uses BigQuery DataFrames (BigFrames) for data processing, analysis and machine learning on BigQuery. It is meant for Python data tasks, and the source says to use bigquery-basics for SQL-first workflows.
Discovers connected data sources and proposes loading options when a workspace lacks the data a question needs. Suited to users who want to connect database, warehouse or cloud sources from the chat.
Guides developers through enabling the Data Manager API, setting up Application Default Credentials, and installing its client libraries. Built for developers who are getting started with the API and need local environment and access setup.
Guides authoring and validating Apache Airflow DAGs for Managed Service for Apache Airflow (MSAA), formerly Cloud Composer. Built for developers who create or extend Airflow DAGs in these environments.
Extracts structured JSON data from over 40 websites, including Amazon, LinkedIn, Instagram, TikTok, Facebook and YouTube. Built on Bright Data's Web Data APIs, it returns product details, profiles, reviews, posts and comments from a URL.
Compare with kaggle-cli, bigquery-bigframes or data-loading
pymc: common questions
Which PyMC version does this skill target?
The skill uses PyMC's modern API, version 5.x or later.
Does it cover variational inference?
Yes. It shows pm.fit with ADVI as a fast approximation for exploration or initialization, and notes it may underestimate uncertainty.
How does it check whether a sampling run worked?
It lists R-hat below 1.01, ESS above 400, no divergences and well-mixed trace plots, and suggests fixes when these checks fail.
How do I install pymc?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is pymc free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is pymc safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to pymc?
Similar skills: kaggle-cli, bigquery-bigframes, data-loading, data-manager-api-setup.
