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
- 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)
- 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)
- Describe how observations are related. Groups, neighbours, time, a network. This chooses the prior structure, and is usually where most of the information is.
- Write down how the data could be imperfect. Missing, censored, truncated, mismeasured, unrepresentative. Modelling the imperfection usually beats cleaning it away. (D02)
- 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)
- 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)
- 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)
- 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… | Consider | Worked in |
|---|---|---|
| A continuous measurement | Normal; Student-t if there are outliers; skew-normal or a distributional model if the spread or shape changes | E01, E41, E43 |
| Yes/no, or successes out of trials | Bernoulli / Binomial with a logit link | E03, C01 |
| Counts | Poisson, or negative binomial when counts are over-dispersed | E04, E33, E18 |
| Ordered categories (Likert scales) | Ordered logistic, with cut-points as parameters | C05 |
| Time until an event, some not yet observed | Weibull or other survival models with pm.Censored | E06, C04, E25 |
| The largest value in each year or block | Generalised extreme value distribution | E37 |
| Points in space and time | A (log-Gaussian) Cox process | E07 |
| A partition or a vocabulary | Chinese restaurant / Pitman–Yor process | E30 |
| A network of ties | Latent-space and stochastic block models | E21 |
| Who beat whom, or a whole finishing order | Bradley-Terry, dynamic skills, Plackett-Luce | E67 |
| A choice among alternatives | Conditional and mixed logit; willingness to pay | E68, C15 |
| Repeated purchases: who competes with whom | Factor-structured hierarchical logit (a choice map) | E84, C15 |
| A household x product 0/1 table (bought it or not) | Bernoulli-logit latent factor model | E85 |
| Directions: wind, angles, time of day | Von Mises and circular densities, joint with speed | E81, C12 |
| Which experiment to run next | Gaussian-process / bounded-yield surrogates and the value of information | E82, C13 |
| A centile, not the mean (growth charts, thresholds) | Bayesian quantile regression with calibration checks | E83, C14 |
| A quick two-way choice and its response time | Drift diffusion model (Wiener first-passage time) | E71 |
| Shares of a whole, or counts split into parts | Dirichlet, logistic-normal and Dirichlet-multinomial models | E70 |
| Counts of many features per item (words, colours, pages, products) | Topic models (LDA) and covariate topic models | E72, E73 |
| Colours or spectra that change with exposure | Kubelka-Munk mixing, fading kinetics rendered through the CIE observer | E74 |
| A spectrum from a colour measurement | Bayesian inversion with a learned spectral prior; metamers | E76 |
| Regions of an image, number unknown | Dirichlet-process mixture with a Potts spatial prior | E75 |
| Names people give to colours | Softmax categories over CIELAB with speaker-level effects | E77 |
2 · How are the observations related?
Dependence between observations is where hierarchical and structured priors earn their keep.
| If your data or question is… | Consider | Worked in |
|---|---|---|
| Observations in groups (schools, counties, markets) | Hierarchical model with partial pooling | E02, E33, E36 |
| Neighbouring regions on a map | ICAR / BYM2 areal models | E18 |
| A smooth surface or curve | Gaussian process (HSGP for speed), splines | E05, E07, C08 |
| A series in time | State-space models, random walks, hidden Markov models | E13, E24, C07 |
| Related species or lineages | Phylogenetic covariance | E23 |
| Many outcomes that move together | Full covariance, factor models, copulas | E22 |
| Unobserved subgroups | Mixtures and Dirichlet-process mixtures | C06, 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… | Consider | Worked in |
|---|---|---|
| Values are missing | Model the missingness jointly instead of dropping rows | D02 |
| Measurements carry known error | Measurement-error model; the error is data | D02, E17 |
| Species or cases can be missed | Occupancy, N-mixture and capture–recapture models | E28 |
| Raters disagree and there is no gold standard | Latent class and Dawid-Skene models | E69 |
| Recent data are still arriving | Nowcasting the reporting delay | E38 |
| The survey sample is unrepresentative | Multilevel regression and poststratification | E36 |
| Only published summaries, not individuals | Meta-analysis on sufficient statistics | E17 |
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… | Consider | Worked in |
|---|---|---|
| Theory gives the equation | Put the physics in the mean function | E08, C01 |
| The system follows a differential equation | ODE inside the model, gradients via JAX | E09, E11 |
| You can simulate but not write a likelihood | Simulation-based inference: ABC, SMC, synthetic likelihood | E14 |
| Unknown non-linear effects of many inputs | BART, Bayesian neural networks, GPs | E15, E29, E05 |
| Many candidate predictors, few matter | Horseshoe and spike-and-slab priors | E27 |
| No standard likelihood fits the process | Derive and test your own | E32 |
| You do not know which shape a response curve has | A flexible family (Weibull transform) written in JAX | E45 |
| The dynamics are chaotic | Latent states with process noise, features not paths, control under the posterior | E46, E47, E48 |
| The process jumps as well as diffuses | Jump-diffusion SDE with the jump count summed out; SV with jumps | E49 |
| Things spread and react in space | Reaction-diffusion PDE by the method of lines, or exactly via an eigenbasis | E50 |
| Transport runs in two coupled compartments (surface and bulk) | Bulk-surface PDE solved exactly per Fourier mode; compare with the 1-D shortcut models | E52 |
| Counts have a heavy jackpot tail with no closed-form likelihood | Compound-Poisson pmf by a triangular solve inside PyTensor; censored top class | E53 |
| A stiff, spiking simulator whose trace likelihood is rugged | Fit summary features with a simulator likelihood (SMC); check sloppy parameter directions | E54 |
| Counts come from a stochastic reaction network | Chemical master equation by finite state projection; ask what snapshots identify | E55 |
| A predictor is measured with error (regression dilution) | Errors-in-variables with the noise identified from the data's own correlation structure | E56 |
| Trajectories blur motion with measurement error | Exact track likelihood (MA(1) via a sine eigenbasis); state mixtures and switching HMMs | E57 |
| How many sources are in the data, and where? | Count as model selection (Laplace / SMC evidence) with a pixelated physical forward model | E58 |
| Waiting times hide an unknown number of sub-steps | Hypoexponential dwell models with ordered rates, LOO over the number of steps; lattice HMM for step detection | E59 |
| An ill-posed inverse problem (deconvolution) | Regularisation as a prior: marginal likelihood for its strength, GP spectra, sparse horseshoe priors | E60 |
| A discrete structural parameter (number of steps) is weakly identified | Marginalise it with logsumexp and parameterise by what the data identify | E61, E59 |
| Doses, concentrations and patients who differ | Hierarchical compartment models; flip-flop checks with multi-start chains; Bayesian therapeutic drug monitoring | E64 |
| Events trigger more events (aftershocks, cascades) | Hawkes / ETAS likelihood with a closed-form compensator; incompleteness in the likelihood; cascade forecasts | E65 |
| You must decide where to put actuators and sensors | Design under the posterior: greedy placement, Monte Carlo closed-loop evaluation | E51 |
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… | Consider | Worked in |
|---|---|---|
| What would have happened without the intervention? | g-computation with pm.do; synthetic control | C09, E34, E15 |
| Does the effect travel through a mediator? | Causal mediation | E35 |
| What is the causal graph? | Structure learning for graphs and DAGs | E20, E19 |
| How much did a driver change the odds of an event? | Attribution with non-stationary extremes | E37 |
| What should we do? | Optimise expected utility over posterior draws | E33, C04, C07 |
| A policy changed for some units, at a threshold, or through an instrument | Difference-in-differences, regression discontinuity, IV; the identifying assumption as a prior | E63 |
| Which variant wins, and when can I stop the test? | Hierarchical effect sizes as the prior, expected-loss stopping, Thompson sampling | E66 |
| The data cannot answer the question as asked | Swap priors, run a fake-data check, then answer the decision or the nearest supported question | E62 |