Tutorials › Nonlinear Mixed-Effects Models (NLME) › Priors for Random-Effect Standard Deviations

Bayesian NLME with MCMC · Tutorial 233 of 797

Priors for Random-Effect Standard Deviations

Learn to specify and compare common priors for random-effect standard deviations, calibrate their scales, and interpret their behavior near zero and in the tails.

Advanced 10 min read

What You'll Learn

  • Define half-normal, half-Student-t, and exponential priors on a random-effect standard deviation.
  • Compare the three prior families near zero and in their upper tails.
  • Calibrate prior scales using a meaningful upper quantile.
  • Translate a random-effect standard deviation into variability on a model parameter scale.
  • Identify common prior-specification errors, including confusing a density at zero with a point mass.

Why the Prior on a Standard Deviation Matters

In a nonlinear mixed-effects model, between-subject variability is often represented by random effects. For one random-effect component, a common model is \(b_{ik}\mid \omega_k \sim N(0,\omega_k^2)\), where \(b_{ik}\) is subject \(i\)'s deviation for component \(k\), and \(\omega_k\) is its population standard deviation. The standard deviation must be nonnegative, but the data may provide limited information about its size, especially when the number of subjects is modest or the component is weakly identified. Its prior can therefore matter appreciably.

This tutorial compares three continuous priors for a single standard deviation \(\omega\): the half-normal, half-Student-t, and exponential. Their densities all have support on nonnegative values and are largest at zero, but they differ in how quickly their densities and tail probabilities decrease. Those differences affect how much prior weight they place on very small variability and on unusually large variability.

Definition: For a random-effect component with \(b_i\mid\omega\sim N(0,\omega^2)\), a prior for \(\omega\) is a distribution on \([0,\infty)\). A half-normal prior is the distribution of \(|Z|\) for \(Z\sim N(0,s^2)\). A half-Student-t prior is the distribution of \(A|T|\), where \(T\) has a Student-t distribution with \(\nu\) degrees of freedom. An exponential prior with rate \(\lambda\) has density \(\lambda e^{-\lambda\omega}\) for \(\omega\geq 0\). Here \(s>0\), \(A>0\), \(\nu>0\), and \(\lambda>0\).

The densities, with respect to \(\omega\), are

$$ \begin{aligned} p_{\mathrm{HN}}(\omega\mid s) &= \sqrt{\frac{2}{\pi}}\frac{1}{s} \exp\!\left(-\frac{\omega^2}{2s^2}\right),\\ p_{\mathrm{Ht}}(\omega\mid A,\nu) &= \frac{2}{A}t_\nu\!\left(\frac{\omega}{A}\right),\\ p_{\mathrm{Exp}}(\omega\mid\lambda) &= \lambda e^{-\lambda\omega},\qquad \omega\geq 0. \end{aligned} $$

In the half-Student-t expression, \(t_\nu(x)\) denotes the density of a standard Student-t random variable with \(\nu\) degrees of freedom, evaluated at \(x\). The factor of 2 makes the density integrate to 1 on the nonnegative half-line. The half-normal scale \(s\), half-Student-t scale \(A\), and exponential mean \(1/\lambda\) have the same units as \(\omega\). Choose those units to match the random effect: a standard deviation on a log-parameter scale is dimensionless, whereas one on a clearance scale has units of clearance.

Behavior at Zero and in the Tails

All three densities have a finite, positive value at zero. Each distribution is continuous, so \(P(\omega=0)=0\): a high density near zero does not assign positive probability to exactly zero variability. A prior that explicitly allows the random effect to be absent with positive probability would require a separate point mass at zero; that is not any of the three continuous priors defined here.

The half-normal density decreases at a rate proportional to \(\exp(-\omega^2/(2s^2))\), which is a Gaussian, or quadratic-exponent, tail. The exponential density decreases as \(\exp(-\lambda\omega)\), so its tail is lighter than the half-Student-t tail but heavier than the half-normal tail at sufficiently large \(\omega\). For a half-Student-t with finite \(\nu\), the density decreases polynomially, proportional to \(\omega^{-(\nu+1)}\), and its upper-tail probability decreases proportional to \(\omega^{-\nu}\). Thus, it assigns more probability to extreme standard deviations than either of the other two families, for fixed positive scales.

At zero, the values of the densities are

$$ p_{\mathrm{HN}}(0\mid s)=\sqrt{\frac{2}{\pi}}\frac{1}{s}, \qquad p_{\mathrm{Ht}}(0\mid A,\nu)=\frac{2t_\nu(0)}{A}, \qquad p_{\mathrm{Exp}}(0\mid\lambda)=\lambda. $$

These values depend on the scales, so comparing them is meaningful only after explaining how the scales were chosen. Nor does the tail ordering mean that the half-Student-t is always more dispersed under every possible calibration; comparing priors requires a shared, interpretable calibration.

Worked Example: Comparing Tail Probabilities at a Common Scale

Suppose \(\omega\) is measured in the units of one random-effect component. For a direct illustration, set \(s=A=0.30\), use \(\nu=3\), and set the exponential rate to \(\lambda=1/0.30=3.333\). These values give the families a common scale parameter, but do not make their quantiles equal.

For the half-normal, \(\omega=s|Z|\) with \(Z\sim N(0,1)\). Therefore,

$$ P(\omega<0.10) = P\!\left(|Z|<\frac{0.10}{0.30}\right) =2\Phi(0.3333)-1 \approx 0.2611. $$

Likewise, \(P(\omega>0.60)=P(|Z|>2)=2[1-\Phi(2)]\approx 0.04550\).

For the half-Student-t, \(\omega=0.30|T|\), where \(T\) has 3 degrees of freedom. Thus,

$$ P(\omega<0.10)=P(|T|<1/3)\approx 0.2392, \qquad P(\omega>0.60)=P(|T|>2)\approx 0.1393. $$

For the exponential prior, \(\lambda=3.333\) per unit of \(\omega\), so

$$ P(\omega<0.10)=1-e^{-3.333(0.10)} =1-e^{-1/3}\approx 0.2835, \qquad P(\omega>0.60)=e^{-3.333(0.60)} =e^{-2}\approx 0.1353. $$

At these chosen values, the half-normal puts the least probability above \(0.60\), while the half-Student-t puts the most. This illustrates the heavier half-Student-t tail; it does not establish a universal comparison for priors calibrated in different ways.

Calibrating Scales With an Upper Quantile

A scale parameter is not itself generally a useful statement of prior belief. A more interpretable calibration is to choose a scientifically plausible upper value \(U\) and specify, for example, that \(P(\omega\leq U)=0.95\). This says that 95% of the prior probability lies at or below \(U\), before observing the data. It does not say that there is a 95% probability the eventual parameter lies below \(U\) after data are observed.

For a half-normal prior, \(\omega=s|Z|\), so \(P(\omega\leq U)=0.95\) requires \(U/s=z_{0.975}\), the 97.5th percentile of the standard normal. For a half-Student-t, the corresponding condition uses the 97.5th percentile \(t_{\nu,0.975}\). For an exponential prior, its cumulative distribution is \(1-e^{-\lambda U}\). Solving these equations gives

$$ s=\frac{U}{z_{0.975}}, \qquad A=\frac{U}{t_{\nu,0.975}}, \qquad \lambda=\frac{-\log(0.05)}{U}. $$

The 0.975 quantile appears for the two half-distributions because \(P(|Z|\leq c)=0.95\) requires 2.5% in each tail of the untruncated, symmetric distribution. The exponential expression follows by setting \(1-e^{-\lambda U}=0.95\) and solving for \(\lambda\).

Worked Example: Matching a 95% Prior Upper Quantile

Suppose the chosen upper value is \(U=0.60\), and compare a half-normal, a half-Student-t with \(\nu=3\), and an exponential prior, each calibrated so that \(P(\omega\leq 0.60)=0.95\).

For the half-normal, \(z_{0.975}\approx1.960\), giving \(s=0.60/1.960\approx0.3061\). Its density at zero is

$$ p_{\mathrm{HN}}(0\mid s) =\frac{\sqrt{2/\pi}}{0.3061} \approx 2.607. $$

For the half-Student-t with 3 degrees of freedom, \(t_{3,0.975}\approx3.182\). Hence \(A=0.60/3.182\approx0.1885\). Since \(t_3(0)\approx0.3676\), its density at zero is

$$ p_{\mathrm{Ht}}(0\mid A,3) =\frac{2(0.3676)}{0.1885} \approx 3.899. $$

For the exponential prior,

$$ \lambda=\frac{-\log(0.05)}{0.60} \approx 4.993, \qquad p_{\mathrm{Exp}}(0\mid\lambda)=4.993. $$

All three priors have the same 95th percentile, yet their densities at zero differ substantially. The shared quantile does not make the distributions identical: their probabilities below other values and their tail shapes still differ. In particular, the half-Student-t retains a polynomial tail even after this calibration.

Interpreting the Standard Deviation in Context

Prior calibration should refer to the role of the random effect in the model, not merely to a number that seems small. If \(b_i\) is a random effect on log clearance, then a one-standard-deviation deviation in \(b_i\) corresponds to a multiplicative factor \(e^\omega\) in clearance relative to its typical value. This interpretation follows from exponentiating the log-scale difference; it does not mean the clearance itself is normally distributed.

Worked Example: Translating a Log-Scale Standard Deviation

Suppose \(b_i\mid\omega\sim N(0,\omega^2)\) is an additive random effect on log clearance. At \(\omega=0.20\), one standard deviation corresponds to a multiplicative factor \(e^{0.20}\approx1.221\). Thus, a one-standard-deviation increase in the random effect multiplies clearance by about 1.221 relative to the typical value.

Conditional on this value of \(\omega\), the central 95% interval for \(b_i\) is approximately \(-1.96(0.20)\) to \(1.96(0.20)\), or \([-0.392,0.392]\). Exponentiating the endpoints gives a central 95% interval for the multiplicative factor of

$$ [e^{-0.392},e^{0.392}]\approx[0.676,1.480]. $$

If a prior is calibrated so that 95% of its mass lies below \(\omega=0.60\), then at that upper value the corresponding conditional central 95% multiplicative range is \([e^{-1.176},e^{1.176}]\approx[0.308,3.241]\). This calculation helps assess whether \(0.60\) is a plausible prior upper value for the particular log-scale random effect. It is conditional on \(\omega=0.60\), not a statement that 95% of individual clearances fall in that range under the entire prior.

Assumptions, Diagnostics, and Limitations

These comparisons concern a scalar standard deviation in a model where the random effect is conditionally normal with mean zero and variance \(\omega^2\). The prior is placed on the standard deviation itself, not on the variance \(\omega^2\). The conclusions about densities at zero also depend on using density with respect to \(\omega\). If instead one defines \(v=\omega^2\), the change-of-variables formula gives

$$ p_v(v)=p_\omega(\sqrt{v})\frac{1}{2\sqrt{v}}, \qquad v>0. $$

Thus, a finite density for \(\omega\) at zero does not imply a finite density for the variance \(v\) at zero. A prior specified on variance and a prior specified on standard deviation are different prior choices.

Before fitting, examine the implied prior on \(\omega\) in the units and parameterization of the model. Check its density near zero, several upper quantiles, and the probability it assigns to values that would imply implausibly large subject-to-subject variation. After fitting, compare the posterior for \(\omega\) with its prior and check whether the posterior is concentrated near zero or has a long upper tail. Such patterns can indicate weak information in the data or a likelihood that does not distinguish small from moderate variability; they do not, by themselves, prove that the model or computation has failed.

A common failure is to choose a very large scale under the label “weakly informative” without checking the consequences. A broad half-Student-t can assign substantial prior probability to extreme standard deviations, which may imply implausible individual parameter values or make inference sensitive to a small number of subjects. Conversely, an overly tight prior can constrain variability toward zero and conceal genuine heterogeneity. Scale and tail behavior must both be checked.

Common mistake: “The half-Student-t density is finite at zero, so it assigns positive probability to no random-effect variability.” This is incorrect: a continuous prior assigns probability zero to the single point \(\omega=0\), even when its density there is high. To assign positive probability to exactly zero, use a model with an explicit point mass at zero; do not interpret a continuous density value as a probability.

The half-normal is often suitable when very large standard deviations should be strongly downweighted. The exponential provides a simple one-parameter prior with an exponentially decreasing tail. The half-Student-t is useful when one wants appreciable tail probability for larger values, but that robustness can also permit implausibly large variability if its scale is not calibrated. No family is universally best: the choice depends on the random-effect scale, scientific plausibility, and how much upper-tail probability is intended. These scalar priors specify marginal standard deviations; they do not specify correlations among multiple random effects.

1
Put the random effect on its model scale.
State what a one-unit change in the random effect means, including whether its units are dimensionless or physical.
2
Choose an interpretable upper value.
Describe what a plausible large standard deviation would imply for individual parameter values.
3
Calibrate and inspect the family.
Set the scale using a stated quantile, then compare its density near zero and its upper-tail probabilities with the modeling context.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. Does a half-normal prior with positive scale assign positive probability to exactly \(\omega=0\)? Explain.
  2. For a half-Student-t with \(\nu=3\), what is the order of its density tail and its upper-tail probability?
  3. A half-normal prior should have \(P(\omega\leq0.40)=0.95\). Approximately what scale \(s\) is required?
  4. Why does matching the 95th percentile of three prior families not make their prior distributions equivalent?

Solutions. (1) No. It is continuous, so \(P(\omega=0)=0\), even though its density at zero is positive. (2) The density decreases proportionally to \(\omega^{-4}\), and the upper-tail probability decreases proportionally to \(\omega^{-3}\). (3) Use \(s=U/z_{0.975}=0.40/1.960\approx0.2041\), in the units of \(\omega\). (4) The calibration fixes only one quantile. The families can still have different densities near zero and different probabilities at other values, particularly in their upper tails.