Why Compare Variance-Component Priors?
A variance-component prior is not merely a technical detail. It expresses how much group-level variability is plausible before observing the outcome data. When the data contain limited information about that variability, reasonable prior choices can lead to noticeably different posterior estimates or uncertainty. Sensitivity analysis makes this dependence visible rather than allowing one chosen prior to appear inevitable.
A fair comparison changes the prior under examination while holding the likelihood, data, and other prior choices fixed. In this tutorial, \(\tau\) denotes a nonnegative random-effect standard deviation, so the corresponding variance component is \(\tau^2\). For a scalar random effect \(b_j\), the usual scale interpretation is \(b_j\mid\tau\sim N(0,\tau^2)\). The focus is comparing plausible prior distributions for \(\tau\), not choosing a specific prior for a particular random-intercept or random-slope structure.
For a GLMM, let \(y\) denote the observed responses and let \(b\) collect the random effects. Conditional on \(b\) and the fixed-effect parameters, the response distribution and link function specify the likelihood. For a candidate prior \(\pi_k(\tau)\), the posterior for \(\tau\) is based on the marginal likelihood
The displayed integral allows nuisance parameters to be integrated under the same specification in every candidate analysis. The posterior exists as a probability distribution when its normalizing integral is finite and positive. The likelihood, the data, and the treatment of nuisance parameters must be comparable across analyses; otherwise, differences cannot be attributed to the variance-component prior alone.
Matching Prior-Predictive Scales
If \(b_j\mid\tau\sim N(0,\tau^2)\), then integrating over a prior on \(\tau\) gives \(E(b_j^2)=E(\tau^2)\), provided this second moment is finite. Thus \(\sqrt{E(\tau^2)}\) is the prior-predictive root-mean-square (RMS) scale of a random effect. Matching this quantity is one useful way to put alternative priors on a common scale before examining the outcome data.
This calibration does not make the priors equivalent. Priors with the same \(E(\tau^2)\) can place different probability near zero, have different medians, and allocate different probability to large values. Those differences are often precisely what the sensitivity analysis should reveal. Matching the RMS is a reference point, not a proof that either prior is appropriate.
Worked Example: Matching Two Discrete Priors on RMS Scale
Suppose two hypothetical priors are proposed for \(\tau\), measured in the response’s linear-predictor units. Prior A places probability \(0.75\) at \(0.5\) and probability \(0.25\) at \(1.5\). Prior B places probability \(p\) at \(1.2\) and probability \(1-p\) at \(0.2\). Choose \(p\) so the priors have the same prior-predictive RMS scale.
For Prior A, the second moment is
For Prior B, set its second moment equal to \(0.75\) and solve:
Therefore Prior B assigns probability \(0.49286\) to \(0.2\) and \(0.50714\) to \(1.2\). Checking the arithmetic, \(0.49286(0.04)+0.50714(1.44)\approx0.01971+0.73029=0.75000\). Both priors give \(\sqrt{E(\tau^2)}=\sqrt{0.75}=0.8660\) linear-predictor units. They are matched on RMS, but Prior A has support at \(0.5\) and \(1.5\), whereas Prior B has support at \(0.2\) and \(1.2\); their implications need not agree.
Posterior Comparisons: A Fully Worked Illustration
The next hypothetical calculation uses a simple one-dimensional Gaussian summary likelihood to make the prior-to-posterior arithmetic transparent. It is an illustrative likelihood, not a claim that a binary or count GLMM has this likelihood. Assume an observed summary \(Y=1\) has likelihood, as a function of \(\tau\),
This likelihood is proportional to the density of a normal observation with mean zero and variance \(\tau^2+0.25\), evaluated at one; the common normalizing constant is omitted because it cancels in posterior probabilities. Apply it to the two RMS-matched priors from the previous example. The assumptions for this calculation are that the likelihood is the same for both analyses, the prior probabilities are as stated, and the priors are proper. For a real GLMM, the corresponding marginal likelihood must be computed from that model’s actual response likelihood and random-effect distribution.
Worked Example: How Matched Priors Produce Different Posteriors
For Prior A, substituting \(\tau=0.5\) gives \(L(0.5)=0.5^{-1/2}\exp(-1)\approx0.5203\). At \(\tau=1.5\), \(L(1.5)=2.5^{-1/2}\exp(-0.2)\approx0.5178\). Bayes’ rule gives the posterior probability of the upper support point:
The posterior mean and second moment are therefore approximately \(E(\tau\mid Y=1)=0.5(1-0.2491)+1.5(0.2491)=0.7491\) and \(E(\tau^2\mid Y=1)=0.25(1-0.2491)+2.25(0.2491)=0.7482\). The posterior standard deviation is \(\sqrt{0.7482-(0.7491)^2}\approx0.4325\).
For Prior B, use \(P(\tau=1.2)=0.50714\) and \(P(\tau=0.2)=0.49286\). The likelihood values are \(L(0.2)=0.29^{-1/2}\exp(-1/0.58)\approx0.3311\) and \(L(1.2)=1.69^{-1/2}\exp(-1/3.38)\approx0.5722\). Thus
The resulting posterior mean is \(0.2(1-0.6400)+1.2(0.6400)\approx0.8400\), and the second moment is \(0.04(1-0.6400)+1.44(0.6400)\approx0.9361\). Hence the posterior standard deviation is \(\sqrt{0.9361-(0.8400)^2}\approx0.4800\).
Although the priors share the same prior-predictive RMS scale, the posterior means and standard deviations differ. In this toy calculation, the evidence shifts the probability toward the higher support value under each prior, but the posterior allocation depends on where each prior placed its mass before seeing the observation. The posterior means are in the units of \(\tau\); they are not variances.
What a Sensitivity Analysis Should Compare
A useful analysis goes beyond choosing a prior that yields a preferred answer. First specify a small set of scientifically defensible candidates and explain what differs between them. Then fit each version of the same GLMM, using the same data, fixed-effect specification, likelihood, and nuisance-parameter priors. Compare quantities that answer the scientific question, not only a single summary of \(\tau\).
For each candidate, useful reports may include the posterior median or mean of \(\tau\), a credible interval, and posterior probabilities for scientifically meaningful ranges, such as \(P(\tau>c\mid y)\) for a stated threshold \(c\). State the units and describe the event in context. A 95% posterior credible interval is an interval containing 95% posterior probability under the specified model and prior; it is not a prior-free guarantee. When the posterior summaries are similar across well-calibrated priors, that is evidence of limited sensitivity for those summaries and those candidates. It does not prove that every plausible prior would give the same result.
The same scale calibration can still allow substantial differences in tail probabilities. For example, compare a half-normal prior with scale \(s=0.8\) to an exponential prior with rate \(\lambda=\sqrt{2}/0.8\). Their second moments are \(s^2=0.64\) and \(2/\lambda^2=0.64\), respectively, so both have RMS \(0.8\). Yet their probabilities of exceeding \(1\) differ:
Worked Example: Matched RMS Does Not Match Tail Probability
For a half-normal prior with scale \(0.8\), \(\tau\) is the absolute value of a normal variable with standard deviation \(0.8\). Therefore \(P(\tau>1)=2\{1-\Phi(1/0.8)\}=2\{1-\Phi(1.25)\}\approx0.2113\). For the exponential prior, \(\lambda=\sqrt{2}/0.8\approx1.7678\), so \(P(\tau>1)=\exp(-\lambda)\approx0.1706\).
Both priors imply the same prior-predictive RMS for \(b_j\), namely \(0.8\), but their prior probabilities of a scale above \(1\) differ by about \(0.041\). This difference can matter when the data provide weak information about the upper tail. The calculation also shows why a sensitivity analysis should inspect distributions and relevant tail events, rather than treating a matched second moment as complete calibration.
Assumptions, Diagnostics, and Failure Modes
Interpret a comparison as prior sensitivity only when its conditions are controlled. The random-effect distribution and definition of \(\tau\) must be the same across candidate fits; the likelihood and data must be unchanged; and the priors on other parameters must also be unchanged unless their joint prior specification is the object of the analysis. Candidate priors should be proper for the posterior comparisons described here, and the matched second moment must exist. The chosen scale is meaningful only relative to the random-effect parameterization, so any rescaling of predictors or random effects must be applied consistently to every prior.
For fitted GLMMs, also verify that posterior computation is adequate under each prior. Check sampler convergence and effective sample sizes when using simulation-based inference, and compare Monte Carlo error with the differences being interpreted. Inspect prior-predictive implications for group effects and, where appropriate, the resulting response probabilities or counts. A prior can have a seemingly reasonable RMS yet imply implausible extremes or too much concentration near zero. If the posterior remains close to the prior, the data may be weakly informative about that component; if computational diagnostics differ markedly between candidates, apparent sensitivity may instead reflect unreliable computation.
A prior with a continuous density on positive \(\tau\) assigns probability zero to the exact event \(\tau=0\). Consequently, posterior probability for a meaningful small-scale range is not the same as posterior probability of an exactly zero variance component. Point-mass priors address that distinct model-comparison question; do not interpret a continuous-prior sensitivity analysis as a test that establishes a positive component.
The main alternatives to RMS matching include matching a prior median, matching a chosen upper quantile, or calibrating a tail probability with subject-matter input. Each emphasizes a different feature of the prior. RMS matching is particularly interpretable when the target is the random-effect magnitude, but it can be sensitive to tail mass because it uses a second moment. Quantile or threshold matching can be more directly tied to plausible ranges, though those choices do not guarantee a common average squared effect. No calibration rule removes the need to justify the candidate priors and examine their prior-predictive implications.
Sensitivity analysis has limits. It cannot compensate for a misspecified conditional response distribution, omitted structure, poor covariate scaling, or a random-effect distribution that is unsuitable for the problem. Nor does agreement across a few candidates establish robustness to all possible priors. Its value is narrower and practical: it identifies which posterior conclusions are stable across a transparent set of plausible prior assumptions and which warrant cautious reporting.
Choose posterior summaries or threshold probabilities that answer the scientific question, and state their units.
Match a stated prior-predictive scale or another clearly motivated feature, then inspect differences in near-zero and tail behavior.
Use the same data, GLMM likelihood, parameterization, and other prior choices in every candidate analysis.
Report posterior differences alongside computational checks and prior-predictive checks; qualify conclusions that depend on the prior.
Check Your Understanding
Answer each question, then check the brief solutions below.
- What quantity is matched when two priors have the same \(E(\tau^2)\) under \(b_j\mid\tau\sim N(0,\tau^2)\)?
- Why is matching \(E(\tau^2)\) insufficient to conclude that two priors will produce the same posterior?
- In the Gaussian summary illustration, what was the posterior probability of the upper support point under Prior B, and what was its posterior mean for \(\tau\)?
- Why is \(P(\tau>c\mid y)\) under a continuous prior not the posterior probability that the variance component is exactly zero?
- Name two checks that help distinguish genuine prior sensitivity from a computational or prior-predictive problem.
Solutions. (1) It matches the prior-predictive second moment of the random effect, \(E(b_j^2)=E(\tau^2)\), and therefore its RMS scale. (2) The priors may differ in concentration, near-zero mass, and tail probability; the likelihood weights those differences when forming the posterior. (3) Approximately \(0.6400\) and \(0.8400\) scale units, respectively. (4) A continuous prior assigns zero probability to the single point \(\tau=0\); \(P(\tau>c\mid y)\) concerns a range of positive scales. (5) Examples include checking sampler convergence and effective sample sizes, comparing Monte Carlo error with posterior differences, and examining prior-predictive group effects or response outcomes.