Guide

From your problem to a model

Bayesian models are built, not selected. The questions below are the ones to ask of your own data, in roughly the order they matter. Each row points to a worked example where that modelling decision is made, checked and, sometimes, got wrong first.

A recipe for a first model

  1. State the estimand. Write the quantity the decision depends on before writing any model: a difference in expected outcomes, a probability of exceeding a threshold, a forecast for next week. Everything else is a means to computing it. (D03, E62)
  2. Identify the unit and the support of the outcome. One row per what? Is the outcome a count, a proportion, a positive quantity, a time with censoring? This chooses the likelihood. (D01)
  3. Describe how observations are related. Groups, neighbours, time, a network. This chooses the prior structure, and is usually where most of the information is.
  4. Write down how the data could be imperfect. Missing, censored, truncated, mismeasured, unrepresentative. Modelling the imperfection usually beats cleaning it away. (D02)
  5. Choose priors on interpretable scales and simulate them. If the prior predictive distribution produces impossible data, the priors are not "weak", they are wrong. (E01)
  6. Fit, then diagnose the computation. Divergences, R-hat and effective sample size are about whether the answer was computed correctly, not whether the model is right. (E02, E12)
  7. Criticise the model. Posterior predictive checks aimed at the features the decision depends on, calibration of held-out predictions, and comparison of alternatives by LOO. (E03)
  8. Report the estimand with its uncertainty, on the scale of the original question, and show it in a way the reader can act on. (E16)

1 · What kind of outcome?

The support and the data-generating process of the outcome choose the likelihood.

If your data or question is…ConsiderWorked in
A continuous measurementNormal; Student-t if there are outliers; skew-normal or a distributional model if the spread or shape changesE01, E41, E43
Yes/no, or successes out of trialsBernoulli / Binomial with a logit linkE03, C01
CountsPoisson, or negative binomial when counts are over-dispersedE04, E33, E18
Ordered categories (Likert scales)Ordered logistic, with cut-points as parametersC05
Time until an event, some not yet observedWeibull or other survival models with pm.CensoredE06, C04, E25
The largest value in each year or blockGeneralised extreme value distributionE37
Points in space and timeA (log-Gaussian) Cox processE07
A partition or a vocabularyChinese restaurant / Pitman–Yor processE30
A network of tiesLatent-space and stochastic block modelsE21
Who beat whom, or a whole finishing orderBradley-Terry, dynamic skills, Plackett-LuceE67
A choice among alternativesConditional and mixed logit; willingness to payE68, C15
Repeated purchases: who competes with whomFactor-structured hierarchical logit (a choice map)E84, C15
A household x product 0/1 table (bought it or not)Bernoulli-logit latent factor modelE85
Directions: wind, angles, time of dayVon Mises and circular densities, joint with speedE81, C12
Which experiment to run nextGaussian-process / bounded-yield surrogates and the value of informationE82, C13
A centile, not the mean (growth charts, thresholds)Bayesian quantile regression with calibration checksE83, C14
A quick two-way choice and its response timeDrift diffusion model (Wiener first-passage time)E71
Shares of a whole, or counts split into partsDirichlet, logistic-normal and Dirichlet-multinomial modelsE70
Counts of many features per item (words, colours, pages, products)Topic models (LDA) and covariate topic modelsE72, E73
Colours or spectra that change with exposureKubelka-Munk mixing, fading kinetics rendered through the CIE observerE74
A spectrum from a colour measurementBayesian inversion with a learned spectral prior; metamersE76
Regions of an image, number unknownDirichlet-process mixture with a Potts spatial priorE75
Names people give to coloursSoftmax categories over CIELAB with speaker-level effectsE77

2 · How are the observations related?

Dependence between observations is where hierarchical and structured priors earn their keep.

If your data or question is…ConsiderWorked in
Observations in groups (schools, counties, markets)Hierarchical model with partial poolingE02, E33, E36
Neighbouring regions on a mapICAR / BYM2 areal modelsE18
A smooth surface or curveGaussian process (HSGP for speed), splinesE05, E07, C08
A series in timeState-space models, random walks, hidden Markov modelsE13, E24, C07
Related species or lineagesPhylogenetic covarianceE23
Many outcomes that move togetherFull covariance, factor models, copulasE22
Unobserved subgroupsMixtures and Dirichlet-process mixturesC06, E26, C11

3 · Is the data imperfect?

Imperfections are part of the generative story, and modelling them is often the difference between a biased and an honest answer.

If your data or question is…ConsiderWorked in
Values are missingModel the missingness jointly instead of dropping rowsD02
Measurements carry known errorMeasurement-error model; the error is dataD02, E17
Species or cases can be missedOccupancy, N-mixture and capture–recapture modelsE28
Raters disagree and there is no gold standardLatent class and Dawid-Skene modelsE69
Recent data are still arrivingNowcasting the reporting delayE38
The survey sample is unrepresentativeMultilevel regression and poststratificationE36
Only published summaries, not individualsMeta-analysis on sufficient statisticsE17

4 · What form does the relationship take?

From a known equation to a flexible function, the choice is how much structure you are willing to assume.

If your data or question is…ConsiderWorked in
Theory gives the equationPut the physics in the mean functionE08, C01
The system follows a differential equationODE inside the model, gradients via JAXE09, E11
You can simulate but not write a likelihoodSimulation-based inference: ABC, SMC, synthetic likelihoodE14
Unknown non-linear effects of many inputsBART, Bayesian neural networks, GPsE15, E29, E05
Many candidate predictors, few matterHorseshoe and spike-and-slab priorsE27
No standard likelihood fits the processDerive and test your ownE32
You do not know which shape a response curve hasA flexible family (Weibull transform) written in JAXE45
The dynamics are chaoticLatent states with process noise, features not paths, control under the posteriorE46, E47, E48
The process jumps as well as diffusesJump-diffusion SDE with the jump count summed out; SV with jumpsE49
Things spread and react in spaceReaction-diffusion PDE by the method of lines, or exactly via an eigenbasisE50
Transport runs in two coupled compartments (surface and bulk)Bulk-surface PDE solved exactly per Fourier mode; compare with the 1-D shortcut modelsE52
Counts have a heavy jackpot tail with no closed-form likelihoodCompound-Poisson pmf by a triangular solve inside PyTensor; censored top classE53
A stiff, spiking simulator whose trace likelihood is ruggedFit summary features with a simulator likelihood (SMC); check sloppy parameter directionsE54
Counts come from a stochastic reaction networkChemical master equation by finite state projection; ask what snapshots identifyE55
A predictor is measured with error (regression dilution)Errors-in-variables with the noise identified from the data's own correlation structureE56
Trajectories blur motion with measurement errorExact track likelihood (MA(1) via a sine eigenbasis); state mixtures and switching HMMsE57
How many sources are in the data, and where?Count as model selection (Laplace / SMC evidence) with a pixelated physical forward modelE58
Waiting times hide an unknown number of sub-stepsHypoexponential dwell models with ordered rates, LOO over the number of steps; lattice HMM for step detectionE59
An ill-posed inverse problem (deconvolution)Regularisation as a prior: marginal likelihood for its strength, GP spectra, sparse horseshoe priorsE60
A discrete structural parameter (number of steps) is weakly identifiedMarginalise it with logsumexp and parameterise by what the data identifyE61, E59
Doses, concentrations and patients who differHierarchical compartment models; flip-flop checks with multi-start chains; Bayesian therapeutic drug monitoringE64
Events trigger more events (aftershocks, cascades)Hawkes / ETAS likelihood with a closed-form compensator; incompleteness in the likelihood; cascade forecastsE65
You must decide where to put actuators and sensorsDesign under the posterior: greedy placement, Monte Carlo closed-loop evaluationE51

5 · Is the question causal, or a decision?

Posterior draws propagate straight into counterfactuals and expected utilities — if the assumptions that make them causal hold.

If your data or question is…ConsiderWorked in
What would have happened without the intervention?g-computation with pm.do; synthetic controlC09, E34, E15
Does the effect travel through a mediator?Causal mediationE35
What is the causal graph?Structure learning for graphs and DAGsE20, E19
How much did a driver change the odds of an event?Attribution with non-stationary extremesE37
What should we do?Optimise expected utility over posterior drawsE33, C04, C07
A policy changed for some units, at a threshold, or through an instrumentDifference-in-differences, regression discontinuity, IV; the identifying assumption as a priorE63
Which variant wins, and when can I stop the test?Hierarchical effect sizes as the prior, expected-loss stopping, Thompson samplingE66
The data cannot answer the question as askedSwap priors, run a fake-data check, then answer the decision or the nearest supported questionE62