Prior Lab
CI-Solver Β· 12 Distributions Β· brms-Syntax Β· Defaults
Β© Dr. Rainer DΓΌsing Β· Interactive Tools by Claude
⟳ Credible Interval β†’ Calculate Parameters
Lower bound
Upper bound
Mass (%)
The core problem when choosing priors: As a researcher you often have a substantive intuition β€” e.g. "95% of plausible effects lie between βˆ’2 and +5" β€” but don't know which parameter values correspond to that intuition. For the Normal distribution this is directly computable (ΞΌ = midpoint, Οƒ from quantile function). For all other distributions no closed-form formula is available. The solver above finds the parameters numerically.
brms Prior Syntax
What is a Prior?
A prior P(ΞΈ) is a probability distribution over possible parameter values, before you see the data. It encodes your prior knowledge.

Too vague (e.g. Uniform): you make no assumptions, but the sampler must explore huge spaces β†’ slow, often divergent.

Too tight: you impede learning from the data. The posterior β‰ˆ prior, regardless of the data.

Weakly informative β†’ the golden middle ground: roughly excludes impossible values, but leaves ample room for learning.
Which distribution to choose?
Unconstrained parameters (Ξ±, Ξ²): NormalStudent-tCauchy

Positive parameters (Οƒ, Ο„, Ξ»): ExponentialHalf-NormalHalf-tGammaLog-Normal

Proportions / probabilities: Beta

Correlation matrices: LKJ

Rule of thumb: Student-t(3,0,Οƒ) as a robust alternative to Normal, as heavier tails tolerate outliers in the prior.
Gelman's Recommendations
For z-standardised variables (SD=1):
Β· Intercept Ξ±: Normal(0, 2.5)
Β· Slope Ξ²: Normal(0, 1)
Β· Dispersion Οƒ: Exponential(1) or Half-Normal(0,1)

For raw scales you need to rescale:
Οƒ_prior β‰ˆ 2–3 Γ— SD(y) / SD(x)

Example reaction times (Mβ‰ˆ400ms, SDβ‰ˆ80ms):
Ξ±: Normal(400, 100), Ξ² per SD(x): Normal(0, 160)
Common Pitfalls
Prior scale not matched to the outcome: Normal(0,1) for a slope on raw scales (e.g. kg, €, ms) implies +1 unit x β†’ Β±1 unit y β€” depending on the scale, absurdly tight or far too wide. Always keep the metric of the outcome in mind.

Οƒ as Normal(0,x) in brms: This is correct β€” brms automatically applies lb=0 (truncation). No special handling needed, no half_normal().

Ξ½ for Student-t too small: Ξ½=1 equals Cauchy (no E[x]), Ξ½=2 has no finite variance. Recommended: Ξ½ β‰₯ 3, typically 3–7 for robustness.

Forgetting a Beta prior for probabilities: zi, zoi, coi parameters in brms are on [0,1] β€” Beta(1,1) is Uniform, Beta(2,8) says: mostly little zero-inflation.
Comparison Table β€” Priors for Οƒ and Ο„
Distributionbrms syntaxE[Οƒ]Heavy tailsWhen?
Exponential(1)exponential(1)1.0βœ—brms default; weakly informative
Half-Normal(1)normal(0,1)0.80βœ—When Οƒ < 2 is expected
Half-Student-t(3,0,1)student_t(3,0,1)~0.90βœ“Compromise; good default choice
Half-Cauchy(1)cauchy(0,1)β€”βœ“βœ“Very vague; large Οƒ values possible
Gamma(2, 0.1)gamma(2,0.1)20βœ—brms default for Ξ½ in Student-t
GLM Prior β€” Help
The Core Problem

Priors in brms must be specified on the model scale (logit or log) β€” but you think in probabilities and rates. These scales are non-linear: Normal(0, 10) on the logit scale sounds vague, but pushes almost all prior mass to the extremes pβ‰ˆ0% and pβ‰ˆ100%.

The solver bridges this gap: you specify your substantive bounds on the outcome scale β€” the solver returns the matching prior parameters on the model scale, ready to use in brms.

The two plots visualise exactly this relationship:

Top plot β€” Model scale: The prior distribution as it must be entered in brms (logit or log scale). Not intuitively readable, but technically correct.

Bottom plot β€” Response scale: What this prior implies on the outcome scale (probability, expected value, OR/RR). This is what we actually care about β€” but cannot be directly specified in brms. Visual reference only.
Why exp(Ξ²) = Multiplier?

Log-link (Poisson/Gamma):
log(ΞΌ) = Ξ± + Ξ²Β·X  β†’  ΞΌ = exp(Ξ±) Β· exp(Ξ²Β·X)

Comparing two groups (X: 0 β†’ 1):

X=0:  ΞΌβ‚€ = exp(Ξ±)
X=1:  ΞΌβ‚ = exp(Ξ± + Ξ²) = exp(Ξ±) Β· exp(Ξ²)
Rate Ratio = μ₁ / ΞΌβ‚€ = exp(Ξ²)

A Ξ² of e.g. 0.69 means: exp(0.69) β‰ˆ 2 β†’ rate doubles. Adding Ξ² on the log scale = multiplying ΞΌ by exp(Ξ²). That is why we think about the prior for Ξ² in terms of ratios, not differences.

Logit-link (Bernoulli/Binomial) β€” exactly the same structure, just with odds instead of rates:
logit(P) = log(P/(1βˆ’P)) = Ξ± + Ξ²Β·X

X=0:  oddsβ‚€ = exp(Ξ±)
X=1:  odds₁ = exp(Ξ± + Ξ²) = exp(Ξ±) Β· exp(Ξ²)
Odds Ratio = odds₁ / oddsβ‚€ = exp(Ξ²)
Intercept β€” Baseline Level

The intercept determines the baseline level when all predictors equal 0.

Logit-link: sigmoid(Ξ±) = baseline probability

"Without therapy, 10–40% of patients recover"
β†’ Input: 0.10 to 0.40
β†’ logit(0.10) β‰ˆ βˆ’2.20 | logit(0.40) β‰ˆ βˆ’0.41
β†’ Solver: Normal(βˆ’1.30, 0.46) on logit scale
ΞΌ < 0, because the baseline is below 50% βœ“

Log-link: exp(Ξ±) = baseline expected value

"Baseline: 3–15 hospital admissions per year"
β†’ Input: 3 to 15
β†’ log(3) β‰ˆ 1.10 | log(15) β‰ˆ 2.71
β†’ Solver: Normal(1.90, 0.41) on log scale
ΞΌ β‰ˆ 1.90, because exp(1.90) β‰ˆ 6.7 β€” midpoint of 3–15 βœ“
Slope / Ξ² β€” Effect per Unit of X

Logit-link β†’ Odds Ratio (OR) = exp(Ξ²):

"Therapy might slightly reduce or strongly increase odds
β€” OR between 0.7 and 4.0 is plausible"
β†’ Input: OR 0.70 to 4.0
β†’ log(0.70) β‰ˆ βˆ’0.36 | log(4.0) β‰ˆ 1.39
β†’ Solver: Normal(0.52, 0.44) on logit scale
ΞΌ > 0, because the prior leans slightly toward positive effects βœ“

Log-link β†’ Rate Ratio (RR) = exp(Ξ²):

"Treatment increases event rate by 50%–5-fold"
β†’ Input: RR 1.5 to 5.0
β†’ log(1.5) β‰ˆ 0.41 | log(5.0) β‰ˆ 1.61
β†’ Solver: Normal(1.01, 0.31) on log scale
ΞΌ > 0, because the prior expects only positive effects βœ“
Rule of Thumb for Slopes
Normal(0, 0.5) β†’ 95%-CrI OR/RR β‰ˆ 0.37–2.7  (moderate)
Normal(0, 1.0) β†’ 95%-CrI OR/RR β‰ˆ 0.14–7.4  (large)
Normal(0, 2.0) β†’ 95%-CrI OR/RR β‰ˆ 0.02–55   (very vague)
Note on ΞΌ = 0: Only when the ratio bounds are symmetric around 1 (product = 1, e.g. 0.5 Γ— 2.0 = 1), the solver necessarily returns ΞΌ = 0. This is the classic "no-effect prior". Asymmetric bounds β€” as in the examples above β€” yield ΞΌ β‰  0 and encode substantive expectations.
β„Ή Prior Lab β€” Help
What will I learn here?
The Prior Lab shows all important prior distributions for brms β€” interactively, with CI-solver and direct brms syntax.
Workflow
Prior Types
Vague (uniform, Cauchy): almost no prior assumptions, but sampler sluggish and often divergent.
Weakly informative: roughly excludes impossible values, leaves ample room for learning β€” the recommended approach.
Strongly informative: only when genuine prior knowledge is available (e.g. from meta-analysis).
Typical defaults for common parameters can be found in the "Load & explore brms defaults" section in the sidebar β€” click to load parameters directly.
Common Decisions
Intercept Ξ±: Student-t(3, 0, 2.5) β€” brms default
Slope Ξ² (z-std.): Normal(0, 1) β€” Gelman
Dispersion Οƒ / Ο„: Exponential(1) or Half-Normal(0,1)
Probability / Prop.: Beta(1,1) to Beta(2,8)
Correlation: LKJ(2) β€” regularised around 0
Reaction times: Log-Normal(ΞΌ, Οƒ) on log scale
Why this matters for Bayes
The prior is not a nuisance β€” it is part of the model. Posterior ∝ Likelihood Γ— Prior. A prior that is too tight dominates the model, one that is too vague slows down the sampler. The CI-solver helps justify prior parameters substantively rather than choosing them arbitrarily.
Next β†’ Prior Predictive Check: verify whether the chosen priors imply sensible predictions β€” before you see the data