pymc
Skill by K-Dense-AI
Builds, samples and checks Bayesian models with PyMC, from prior predictive checks to PSIS-LOO model comparison. It is aimed at analysts doing probabilistic modeling and uncertainty inference in Python.
Install pymc
Built from the published package, never by AI.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/pymc ~/.claude/skills/pymcRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/scientific-agent-skills/skills/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
The pymc skill guides an AI assistant through Bayesian modeling with PyMC 6.3.2, PyTensor 3.3.2 and ArviZ 1.3. It covers defining the estimand and priors, running a prior predictive check, fitting with NUTS MCMC or variational inference, and inspecting convergence diagnostics. It also covers posterior predictive checks, predictions on new data, and model comparison with PSIS-LOO and model averaging.
The skill includes bundled helper scripts for diagnostics and model comparison, plus runnable synthetic linear and hierarchical templates. It stresses recording seeds, backend, data provenance and the limits of diagnostics and approximations. It is intended for researchers and data scientists who need probabilistic models with calibrated uncertainty in Python.
Written from the project's SKILL.md and checked against it.
What it can do
- Model buildingBuilds generative models with named dimensions and calibrated priors, including hierarchical models.
- Prior predictive checkRuns prior predictive checks and summaries before fitting the model.
- NUTS MCMC samplingFits models with the PyMC NUTS sampler across several chains with explicit seeds.
- Convergence diagnosticsInspects R-hat, bulk and tail ESS, MCSE, divergences, energy BFMI and tree depth.
- Variational inferenceFits approximate posteriors with pm.fit and notes where they can miss uncertainty.
- Posterior predictive checksGenerates posterior predictive replicates and inspects residuals, tails and group effects.
- Predictions on new dataPredicts with mutable data, including unseen groups in hierarchical models.
- PSIS-LOO model comparisonCompares models by PSIS-LOO ELPD and checks LOO reliability using bundled helpers.
- Model averagingBuilds predictive mixtures of models that preserve within- and between-model variation.
What you need
- Python 3.12 or newer
- PyMC 6.3.2, PyTensor 3.3.2 and ArviZ 1.3-compatible dependencies
- NumPy, pandas, Matplotlib, h5netcdf and h5py
- Network access for installation only
- Optional nutpie, NumPyro or BlackJAX for alternative samplers
Try asking
- Build a hierarchical Bayesian model of my grouped measurements in PyMC
- Run a prior predictive check before fitting my PyMC model
- Compare two PyMC models with PSIS-LOO and check the LOO reliability
Good to know
- Optional samplers, SMC and production-scale convergence are not validated by the native tests.
- The short template runs test execution and artifacts, not converged scientific estimates.
- Variational inference can miss modes and underestimate uncertainty.
- Stacking weights are predictive combination weights, not posterior model probabilities.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/pymc/SKILL.md, skills/pymc/assets/hierarchical_model_template.py, skills/pymc/assets/linear_regression_template.py, skills/pymc/scripts/model_comparison.py, skills/pymc/scripts/model_diagnostics.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Read Write Edit Bash
-
SKILL.md10 KB -
assets/hierarchical_model_template.py6 KB -
assets/linear_regression_template.py5 KB -
references/distributions.md15 KB -
references/model_patterns.md5 KB
Show all 10 files
-
references/sampling_inference.md8 KB -
references/standard_workflow.md5 KB -
references/workflows.md8 KB -
scripts/model_comparison.py14 KB -
scripts/model_diagnostics.py9 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
Does pymc need a remote service or API key?
The source says these are local Python APIs with no service endpoint, credentials or remote inference required. Network access is needed only for installation.
Which sampler does the pymc skill use?
It uses NUTS MCMC and recommends nuts_sampler="pymc" for reproducible backend selection. It also covers variational inference.
Can the pymc skill compare models?
Yes. It uses PSIS-LOO ELPD through ArviZ and includes helpers for LOO reliability checks, model comparison and model averaging.
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.
