Tutorials › Generalized Linear Mixed Models (GLMM) › Half-Student-t Priors for Random-Effect Standard Deviations

Bayesian GLMM and Prior Specification for Variance Components · Tutorial 246 of 698

Half-Student-t Priors for Random-Effect Standard Deviations

Learn to specify a half-Student-t prior for a random-effect standard deviation and calculate how its scale and degrees of freedom govern the probability of large values.

Advanced 10 min read

What You'll Learn

  • Define the half-Student-t prior using its degrees of freedom and scale.
  • Derive its density and tail-probability formula from a standard Student-t distribution.
  • Calculate the prior probability of a random-effect standard deviation exceeding a threshold.
  • Compare half-Student-t tails with a half-normal prior and with different degrees of freedom.
  • Interpret the scale parameter, quantiles, and tail probabilities in the units of the random effect.
  • Identify prior choices that can make large group-level variation more or less plausible than intended.

Why Use a Half-Student-t Prior?

A random-effect standard deviation must be nonnegative, but the data may not determine its plausible range precisely, especially when there are few groups. A prior for that standard deviation therefore matters: it helps define which amounts of group-to-group variation receive substantial prior support. The half-Student-t family provides a flexible choice. Its degrees of freedom control tail heaviness, while its scale sets the units and broad magnitude of the prior.

Consider a GLMM with a normally distributed random intercept \(b_j\) for group \(j\), conditional on its standard deviation \(\sigma\):

$$ b_j\mid \sigma \sim N(0,\sigma^2),\qquad \sigma>0. $$

The prior discussed here is assigned to \(\sigma\), not directly to the individual \(b_j\). For a random intercept in a logistic model, \(\sigma\) is measured in log-odds units. For a random slope, it is measured in the units of that slope coefficient. The interpretation and numerical scale must therefore match the model parameter.

Definition: Let \(T\) have a standard Student-t distribution with \(\nu>0\) degrees of freedom, with density \(f_\nu\) and cumulative distribution function \(T_\nu\). For scale \(s>0\), a half-Student-t prior for a standard deviation is the distribution of \(\sigma=s|T|\). Its density is $$ \pi(\sigma\mid \nu,s)=\frac{2}{s}f_\nu\left(\frac{\sigma}{s}\right),\qquad \sigma>0. $$ Here \(\nu\) is the degrees of freedom and \(s\) is the scale parameter.

The factor of 2 folds the symmetric Student-t density onto the nonnegative half-line. Thus the density integrates to one over \(\sigma>0\). The prior is proper for every \(\nu>0\) and \(s>0\). It assigns zero probability to any exact value, including \(\sigma=0\); it is a continuous prior, not a model that assigns a separate probability to zero variance.

Tail Probabilities and Prior Interpretation

A useful way to understand the prior is to calculate the probability it assigns to standard deviations above a substantively meaningful threshold \(c>0\). Because \(\sigma=s|T|\), the event \(\sigma>c\) is the event \(|T|>c/s\). By symmetry of the standard Student-t distribution,

$$ P(\sigma>c) =P\left(|T|>\frac{c}{s}\right) =2\left\{1-T_\nu\left(\frac{c}{s}\right)\right\}. $$

This formula separates the two controls. The ratio \(c/s\) compares the threshold to the prior scale. At fixed \(s\), decreasing \(\nu\) makes the tails heavier, so sufficiently large standard deviations are more plausible. At fixed \(\nu\), increasing \(s\) increases the probability of exceeding a fixed positive threshold. These are statements about prior probabilities, not posterior conclusions about the data.

Worked Example: A Large Random-Intercept Standard Deviation

Suppose a hypothetical logistic random-intercept model uses \(\sigma\sim\text{half-}t(\nu=3,s=0.5)\), with both \(\sigma\) and \(s\) measured in log-odds units. Find the prior probability that \(\sigma\) exceeds \(1.5\) log-odds units.

The standardized threshold is \(1.5/0.5=3\). The tail formula gives

$$ P(\sigma>1.5) =2\{1-T_3(3)\} =2(1-0.9711655) \approx 0.05767. $$

Thus this prior assigns about \(5.767\%\) probability to a random-intercept standard deviation above \(1.5\) log-odds units. This is a statement about the prior distribution. It does not say there is a \(5.767\%\) probability that a fitted model’s unknown standard deviation exceeds that threshold after observing data.

The scale \(s\) is not generally the prior mean or standard deviation of \(\sigma\). For \(\nu>1\), its prior mean is

$$ E(\sigma) =s\frac{\sqrt{\nu}\,\Gamma\left((\nu-1)/2\right)} {\sqrt{\pi}\,\Gamma(\nu/2)}. $$

For \(\nu>2\), its second moment is \(E(\sigma^2)=s^2\nu/(\nu-2)\); for \(\nu\leq 2\), that second moment is infinite. The scale therefore gives a reference magnitude, while the tail behavior can make the mean or variance much larger than the scale suggests—or make a moment fail to exist altogether. In practice, threshold probabilities and quantiles are often more directly interpretable than moments.

How Degrees of Freedom and Scale Change the Tails

For a fixed scale, smaller \(\nu\) gives a heavier tail than larger \(\nu\). As \(\nu\) increases without bound, the standard Student-t distribution approaches the standard normal distribution. Accordingly, a half-Student-t prior with fixed scale approaches a half-normal prior with that same scale. The comparison is especially informative for thresholds several scale units from zero.

Worked Example: Comparing Degrees of Freedom and Scale

Suppose \(\sigma\) is measured in log-odds units and the threshold of interest is \(1.5\). First compare \(\nu=1\) and \(\nu=3\) at the same scale \(s=0.5\). The standardized threshold is 3 for both priors. For \(\nu=1\), the standard Student-t distribution is Cauchy, so

$$ P(\sigma>1.5) =2\left\{1-\left(\frac{1}{2}+\frac{\arctan(3)}{\pi}\right)\right\} =1-\frac{2\arctan(3)}{\pi} \approx 0.2048. $$

For \(\nu=3\), the calculation in the previous example gives \(P(\sigma>1.5)\approx0.05767\). At this threshold, the \(\nu=1\) prior assigns substantially more probability to large standard deviations than the \(\nu=3\) prior, even though both have the same scale.

Now hold \(\nu=3\) fixed and increase the scale to \(s=0.75\). The standardized threshold becomes \(1.5/0.75=2\). Using \(T_3(2)\approx0.93036\),

$$ P(\sigma>1.5) =2\{1-T_3(2)\} \approx 2(1-0.93036) \approx 0.1393. $$

Increasing the scale from \(0.5\) to \(0.75\) log-odds units raises the prior probability of exceeding \(1.5\) from about \(5.767\%\) to about \(13.93\%\). The two comparisons isolate different choices: \(\nu\) changes tail heaviness, and \(s\) changes the scale relative to the threshold.

A half-normal prior is a lighter-tailed alternative. If it is formed as the absolute value of a \(N(0,s^2)\) variable, its tail probability is \(2\Phi(-c/s)\), where \(\Phi\) is the standard normal cumulative distribution function. At \(\nu=3\) and \(s=0.5\), the same threshold \(c=1.5\) gives

$$ P(\sigma>1.5)=2\Phi(-3)\approx0.002700. $$

That is about \(0.2700\%\), compared with \(5.767\%\) for the half-Student-t prior with \(\nu=3\) and \(s=0.5\). Matching scale parameters does not make the two priors equivalent: the tail probability can differ sharply. More generally, the Student-t density has polynomially decaying tails, whereas the normal density decays exponentially in the squared standardized value.

Worked Example: Finding a Prior’s 95th Percentile

Suppose a hypothetical prior for a random-intercept standard deviation is half-Student-t with \(\nu=3\) and \(s=0.5\) log-odds units. Find its 95th percentile.

For \(q>0\), the half-Student-t cumulative distribution function is \(P(\sigma\leq q)=2T_\nu(q/s)-1\). Set this equal to \(0.95\):

$$ 2T_3(q/0.5)-1=0.95 \quad\Longrightarrow\quad T_3(q/0.5)=0.975. $$

The 97.5th percentile of a standard Student-t distribution with 3 degrees of freedom is approximately \(3.182\). Therefore,

$$ q=0.5(3.182)\approx1.591. $$

The prior’s 95th percentile is about \(1.591\) log-odds units: under this prior, 95% of its probability lies below that value and 5% lies above it. This is a prior quantile, not a 95% posterior credible interval.

Justification of the Tail Formula

The tail calculation follows directly from the definition and symmetry; it does not require an approximation. Since \(s>0\), dividing the event \(\sigma>c\) by \(s\) preserves the inequality. Since \(\sigma=s|T|\), the event becomes \(|T|>c/s\). The two disjoint possibilities are \(T>c/s\) and \(T<-c/s\). Symmetry makes their probabilities equal, and each is \(1-T_\nu(c/s)\). Hence

$$ \begin{aligned} P(\sigma>c) &=P\left(T>\frac{c}{s}\right)+P\left(T<-\frac{c}{s}\right)\\ &=1-T_\nu\left(\frac{c}{s}\right) +1-T_\nu\left(\frac{c}{s}\right)\\ &=2\left\{1-T_\nu\left(\frac{c}{s}\right)\right\}. \end{aligned} $$

The same symmetry gives the cumulative distribution function for \(q\geq0\): \(P(\sigma\leq q)=2T_\nu(q/s)-1\). The factor of 2 in both expressions is essential: a half-Student-t prior uses both tails of the original symmetric distribution, folded onto the positive axis.

Specification Checks, Comparisons, and Limitations

Before using a half-Student-t prior, state the random-effect coefficient and its units, then assess thresholds in those same units. Useful checks include calculating \(P(\sigma>c)\) for one or more values of \(c\), and calculating a quantile such as the 95th percentile. Those summaries make it easier to see whether the chosen tail and scale imply plausible amounts of group heterogeneity.

The main lighter-tailed comparison is the half-normal prior. A half-Student-t prior can be useful when it is desirable to retain appreciable prior support for large standard deviations without making the prior improper. However, a heavy tail is not automatically safer: it can place more prior probability on implausibly large variation. The model, measurement scale, and scientific context still determine whether that support is reasonable. A prior on the variance rather than the standard deviation is another possible parameterization; the induced distribution on \(\sigma\) must be considered before comparing its implications.

A continuous half-Student-t prior also cannot represent a prior hypothesis that the variance is exactly zero with positive probability. Its density is defined over positive values, and \(P(\sigma=0)=0\). In addition, prior probabilities for large scales do not show whether the observed data can estimate \(\sigma\) precisely. Sparse groups or weak information can leave posterior conclusions sensitive to the prior. These are reasons to examine the model’s implications and uncertainty, not reasons to interpret a prior tail probability as a data-based finding.

Common pitfall: Saying “the scale is \(0.5\), so standard deviations above \(1.5\) are negligible” ignores the degrees of freedom. With \(s=0.5\) and \(\nu=3\), the probability above \(1.5\) is about \(0.05767\); the half-normal prior with the same scale gives about \(0.002700\). Calculate the tail probability for the specified family instead of inferring it from the scale alone.

Check Your Understanding

Answer each question using the half-Student-t tail and cumulative distribution formulas. Solutions follow the questions.

  1. For \(\nu=3\), \(s=0.5\), and threshold \(c=1.0\), what is \(P(\sigma>c)\)? Use \(T_3(2)\approx0.93036\).
  2. If \(s\) increases while \(\nu\) and a positive threshold \(c\) stay fixed, what happens to \(P(\sigma>c)\), and why?
  3. For a half-Student-t prior with \(\nu=3\) and \(s=0.5\), express the 90th percentile in terms of a standard Student-t quantile.
  4. Why is it incorrect to interpret \(s\) as the prior standard deviation of \(\sigma\) for every value of \(\nu\)?

Solutions. (1) The standardized threshold is \(1.0/0.5=2\), so \(P(\sigma>1.0)=2\{1-T_3(2)\}\approx2(1-0.93036)=0.1393\). (2) The ratio \(c/s\) decreases as \(s\) increases. The Student-t upper-tail probability at that smaller positive threshold increases, so the probability of exceeding \(c\) increases. (3) Set \(2T_3(q/0.5)-1=0.90\), giving \(q=0.5T_{3,0.95}\), where \(T_{3,0.95}\) denotes the 95th percentile of a standard Student-t distribution with 3 degrees of freedom. (4) \(s\) is the distribution’s scale parameter. The second moment of \(\sigma\) exists only for \(\nu>2\) and then is \(s^2\nu/(\nu-2)\), not \(s^2\); for \(\nu\leq2\), it is infinite.

Clinical Biostats