Skip to content
Skills Library
Data & analytics · Building & coding

pymc-modeling

/pymc-modeling

Build, revise, and debug Bayesian models with PyMC. Use when choosing likelihoods and priors, specifying model/data dimensions, fitting hierarchical models, GPs, time series, mixtures, BART or splines, using pymc-extras distributions, marginalization, state-space models or model-building tools, selecting inference methods, resolving failed initial evaluation or model/data shape errors, generating predictions, or testing model code with simulated data and simulation-based calibration (SBC). Covers PyMC 6+, PyTensor 3+ and ArviZ 1.0 DataTree workflows.

Licence
MIT
Last repository change
04.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
23
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 04.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build, revise, and debug Bayesian models with PyMC. Use when choosing likelihoods and priors, specifying model/data dimensions, fitting hierarchical models, GPs, time series, mixtures, BART or splines, using pymc-extras distributions, marginalization, state-space models or model-building tools, selecting inference methods, resolving failed initial evaluation or model/data shape errors, generating predictions, or testing model code with simulated data and simulation-based calibration (SBC). Covers PyMC 6+, PyTensor 3+ and ArviZ 1.0 DataTree workflows.

Original author description

Build, revise, and debug Bayesian models with PyMC. Use when choosing likelihoods and priors, specifying model/data dimensions, fitting hierarchical models, GPs, time series, mixtures, BART or splines, using pymc-extras distributions, marginalization, state-space models or model-building tools, selecting inference methods, resolving failed initial evaluation or model/data shape errors, generating predictions, or testing model code with simulated data and simulation-based calibration (SBC). Covers PyMC 6+, PyTensor 3+ and ArviZ 1.0 DataTree workflows.

How it works

  1. Choose the primary task
  2. Workflow
  3. Read only what the task needs
Original SKILL.md headings · 99 lines, 795 words
SKILL.md preview
---
name: pymc-modeling
description: >-
  Build, revise, and debug Bayesian models with PyMC. Use when choosing
  likelihoods and priors, specifying model/data dimensions, fitting hierarchical
  models, GPs, time series, mixtures, BART or splines, using pymc-extras
  distributions, marginalization, state-space models or model-building tools,
  selecting inference methods, resolving failed initial evaluation or model/data
  shape errors, generating predictions, or testing model code with simulated data
  and simulation-based calibration (SBC). Covers PyMC 6+, PyTensor 3+ and ArviZ
  1.0 DataTree workflows.
---

# PyMC modeling

Choose a useful starting point: a simple scaffold, an established subject-matter
model, or a decomposition of a larger target model. Expand, simplify or branch
as the question, data and checks warrant. Use the consuming project's data and
Python environment; check installed APIs and package compatibility.

For `pymc-extras` tasks, start with [feature selection and compatibility](references/pymc-extras.md),
then load only the relevant workflow reference. Prefer its supported algorithms
to bespoke implementations; do not use an extension merely because it is installed.

## Choose the primary task

- Construct, fit or initialize a model: use `pymc-modeling`.
- Elicit prior assumptions or check prior-predictive plausibility: use
  `prior-elicitation` when available.
- Diagnose an existing completed fit or evaluate its predictions: use
  `arviz-diagnostics` when available.
- Repair symbolic computation, broadcasting, gradients or compilation: use
  `pytensor-workflows` when available.
- Track experiments, preserve MLflow artifacts or restore a logged MMM model: use
  `pymc-mlflow` when available.

Multipart requests can use more than one skill. The references below support
modeling when specialist skills are not installed.

## Workflow

1. **Formulate.** State the estimand or prediction target, observation units,
   outcome support, grouping/time structure, selection and missingness, and what
   information is available at prediction time. Separate predictive, inferential
   and causal claims; respect data authorization and retain source identities.
2. **Specify and inspect.** Match the likelihood to the observation process;
   choose identifiable parameterizations and priors in declared units. Check
   row alignment, shapes, support and finite initial log density. Ordinary `dims`
   label positional tensors; they do not join coordinates.
   Use known-parameter simulated cases to probe new implementations and their
   failure modes; use scoped SBC when repeated inference checks are warranted.
3. **Check prior predictions.** Simulate before fitting and compare support,
   scales and decision-relevant features to domain knowledge. Do not tune priors
   solely to the realized extrema.
4. **Explore, then fit for inference.** Prefer nutpie when compatible and installed.
   Short preliminary fits can reveal bugs, difficult geometry or gross misfit;
   label them exploratory, not reliable posterior inference. For reportable
   results, allocate warmup and draws from adaptation and required ESS/MCSE.
   Save results before diagnostics or plotting.
5. **Diagnose, then criticize.** Inspect divergences, rank R-hat, bulk/tail ESS,
   MCSE and chain/rank plots. Diagnose every divergence. Unreliable computation
   leaves posterior conclusions unresolved; it does not disprove a likelihood.
   Use posterior predictive discrepancies to check the observation model.
   In-sample PPCs are not held-out validation.
6. **Predict, decide and revise.** Preserve training identities and align new
   inputs; distinguish latent means from noisy observations. For recommendations,
   propagate uncertainty through stated consequences, utilities and constraints,
   or hand off the inference without inventing the decision maker's values.
   Retain relevant model variants and explain how changed assumptions affect
   estimands, predictions and decisions—not just which has the best score.
   Adaptive PPC/CV-driven search can overfit; do not present its winner as uniquely
   confirmed or change seeds/criteria merely to obtain a favorable result.

PyMC 6 returns `xarray.DataTree`: use `idata["posterior"]`, not attribute group
access. Call `pm.compute_log_likelihood(idata, model=model)` explicitly before
LOO or other pointwise-likelihood workflows. ArviZ 1.0 uses LOO, not removed WAIC;
state interval probability and type (the default is 89% ETI). Similar stacking
weights do not imply model equivalence.
Sampler preferences, warmup starting points and interval defaults are implementation
conventions, not universal Bayesian workflow requirements. Choose them for the task.

## Read only what the task needs

| When working on | Reference |
|---|---|
| End-to-end fitting, diagnostics and scientific checks | [Workflow](references/workflow.md) |
| Model construction, data containers and dimensions | [Model and data](references/model-data-dimensions.md) |
| Failed initialization, shape errors, stuck sampling or warnings | [Troubleshooting](references/troubleshooting.md) |
| Group effects, pooling and parameterization | [Hierarchical models](references/hierarchical.md) |
| Outcome support, censoring, multivariate families and Jacobians | [Likelihoods](references/likelihoods.md) |
| Algorithms, backends, budgets and persistence | [Sampling](references/sampling.md) |
| pymc-extras feature selection, compatibility and validation | [PyMC Extras](references/pymc-extras.md) |
| Markov chains, specialized counts, extreme values and histogram likelihoods | [Extras distributions](references/extras-distributions.md) |
| Kalman-marginalized models, structural components and forecasting | [Extras state-space workflows](references/extras-statespace.md) |
| Prior factories, model packaging, VIP and posterior-as-prior transfer | [Extras model tools](references/extras-model-tools.md) |
| Variational, Laplace and Pathfinder approximations | [Approximate inference](references/approximate-inference.md) |
| Covariance models and finite-basis error | [Gaussian processes](references/gaussian-processes.md) |
| Temporal dependence, differential equations and forecasting | [Time series](references/time-series.md) |
| Label invariance and discrete elimination | [Mixtures](references/mixtures.md) |
| External densities, simulators and predictive callbacks | [Custom likelihoods](references/custom-likelihoods.md) |
| Conditioning, interventions and graph transformations | [Transformations](references/transformations.md) |
| In-sample criticism and new-input prediction | [Predictive checks](references/predictive-checks.md) |
| Tree ensembles and prediction state | [BART](references/bart.md) |
| Basis penalties and distributional predictors | [Splines](references/splines-distributional.md) |
| Simulated-data experiments, SBC, numerical oracles and mocks | [Model testing](references/model-testing.md) |
| Advanced numerical and extension interfaces | [Interface boundaries](references/interface-boundaries.md) |

For version-specific APIs, use `help()` or `inspect.signature()` on the installed
object in the consuming environment, then consult version-matched official
documentation or source.
Files in this package (23)
  • LICENSE 1 KB
  • SKILL.md 7 KB
  • references/approximate-inference.md 17 KB
  • references/bart.md 8 KB
  • references/custom-likelihoods.md 7 KB
  • references/extras-distributions.md 23 KB
  • references/extras-model-tools.md 14 KB
  • references/extras-statespace.md 23 KB
  • references/gaussian-processes.md 9 KB
  • references/hierarchical.md 6 KB
  • references/interface-boundaries.md 4 KB
  • references/likelihoods.md 15 KB
  • references/mixtures.md 16 KB
  • references/model-data-dimensions.md 7 KB
  • references/model-testing.md 8 KB
  • references/predictive-checks.md 7 KB
  • references/pymc-extras.md 6 KB
  • references/sampling.md 11 KB
  • references/splines-distributional.md 7 KB
  • references/time-series.md 8 KB
  • references/transformations.md 8 KB
  • references/troubleshooting.md 3 KB
  • references/workflow.md 13 KB

Versions

RepositoryScoreLicence
This page · pymc-labs/pymc-modeling90MIT
pymc-devs/pymc-agent-skills90MIT

Database snapshot: 13.11.2026 · package version 091684237d06 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100pymc-fundamentals
    Foundational knowledge for writing current PyMC models including syntax, distributions, sampling, and ArviZ diagnostics. Use when creating or reviewing PyMC models.
  • 100pymc
    Builds and checks Bayesian models with PyMC, including hierarchical models, NUTS MCMC, variational inference, mutable-data predictions, posterior predictive checks, diagnostics, and PSIS-LOO model comparison. Use for probabilistic modeling and uncertainty inference in PyMC.
  • 100alterlab-pymc
    Bayesian modeling and probabilistic programming with PyMC 6 and ArviZ 1.x — hierarchical models, MCMC (NUTS via PyMC, nutpie, NumPyro, or BlackJAX), variational inference, PSIS-LOO model comparison, and prior/posterior predictive checks. Use when fitting Bayesian or hierarchical…
  • 100pymc-mlflow
    Track PyMC experiments with MLflow, record sampling configuration and diagnostics, save and retrieve DataTree artifacts, and compare runs. Use for pymc_marketing.mlflow autologging, MMM model persistence and MLflow registry preparation, or CLV fit tracking. Distinguishes…
  • 100bayesian-statistician
    Think and work like an expert Bayesian Statistician. Use when a task calls for Bayesian Statistician judgment. Reasons from Bayes' rule, coherent uncertainty, exchangeability, and partial-pooling hierarchy through Stan/PyMC HMC-NUTS fits, prior and posterior predictive checks,…
  • 90data-science-statistical-analysis
    Use this skill when performing statistical analysis, hypothesis testing, regression analysis, time series forecasting, Bayesian inference, descriptive statistics, data exploration, or any general statistical modeling. This skill enforces: proper data exploration before modeling,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.