Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Sensitivity to the Random-Effects Distribution

Bayesian Joint Models · Tutorial 329 of 697

Sensitivity to the Random-Effects Distribution

Compare Gaussian random-effects priors with heavy-tailed and mixture alternatives, while keeping their scales interpretable and assessing how the choices affect joint-model inferences.

Advanced 12 min read

What You'll Learn

  • State the shared-random-effects joint model and identify which distributional assumption is being varied.
  • Calibrate Student-\(t\) and mixture priors so comparisons have a clear scale interpretation.
  • Calculate how an alternative random-effects prior changes posterior shrinkage in a worked example.
  • Assess sensitivity in association parameters and survival predictions without confusing it with sampling error.
  • Recognize diagnostics and limitations of distributional sensitivity analyses.

Why examine the random-effects distribution?

In a shared-random-effects joint model, the distribution assigned to subject-specific effects is part of the model, not merely a computational convenience. A Gaussian distribution can be a useful baseline: it is tractable, describes variation through a covariance matrix, and often supports stable estimation. But it also gives a particular shape to the population distribution of latent trajectories. If some subjects have unusually large deviations, or if the population contains subgroups, a Gaussian assumption can affect shrinkage, the estimated association with the event process, and resulting survival predictions.

Sensitivity analysis asks a focused question: how much do the inferences change when the random-effects distribution is specified differently, while the other modeling choices are held as comparable as possible? It does not establish which distribution is true. It reveals whether the conclusions depend materially on a distributional assumption that is difficult to verify from observed data alone.

Model and comparison target

Let \(Y_{ij}\) be the longitudinal outcome for subject \(i\) at visit time \(t_{ij}\), and let \(T_i\) and \(\delta_i\) denote the observed event or censoring time and event indicator. Let \(b_i\) be a vector of subject-specific random effects. A typical shared-effects model has a longitudinal submodel and an event submodel linked through the latent trajectory \(m_i(t;b_i)\):

$$ Y_{ij}=x_{ij}^{\mathsf T}\beta+z_{ij}^{\mathsf T}b_i+\epsilon_{ij}, \qquad h_i(t\mid b_i)=h_0(t)\exp\{w_i^{\mathsf T}\gamma+\alpha m_i(t;b_i)\}. $$

Here \(x_{ij}\) and \(z_{ij}\) are covariate vectors, \(\beta\) and \(\gamma\) are regression parameters, \(h_0(t)\) is the baseline hazard, and \(\alpha\) is the association parameter. For example, \(m_i(t;b_i)\) might be the subject-specific mean marker value at time \(t\). The Gaussian baseline specification is \(b_i\sim N(0,D)\), where \(D\) is the random-effects covariance matrix. The random effects are shared because the same \(b_i\) contributes to both the longitudinal and event submodels.

Definition: Sensitivity to the random-effects distribution is the change in posterior inference that results from replacing the distributional specification for \(b_i\), while keeping the likelihood, covariates, link structure, baseline-hazard specification, and other prior choices fixed or explicitly matched. The comparison concerns modeling assumptions, not a test that selects a uniquely correct distribution.

For a meaningful comparison, alternatives should have comparable locations and scales. A common choice is to retain \(E(b_i)=0\) and match \(\operatorname{Var}(b_i)=D\), when that variance exists. This makes the contrast primarily about shape, especially tail behavior. In a \(q\)-dimensional model, one alternative is a multivariate Student-\(t\) distribution. If its degrees of freedom are \(\nu>2\), then a \(t_\nu(0,S)\) distribution with scale matrix \(S\) has covariance \(\nu S/(\nu-2)\). To match covariance \(D\), set \(S=(\nu-2)D/\nu\). A smaller \(\nu\) gives heavier tails, while retaining the stated covariance.

Another option is a mixture prior, such as a weighted combination of a narrower and a broader Gaussian distribution. A mixture can represent a small proportion of subjects with more extreme effects without forcing all subjects to follow one heavy-tailed shape. Its weights and component scales require substantive prior justification; they should not be chosen merely because they produce a desired posterior result.

Worked Example: A Gaussian and mixture prior

Worked Example: A Gaussian and mixture prior

Consider a simplified scalar random effect \(b\) and a noisy subject-level summary \(y=3\), with likelihood \(y\mid b\sim N(b,0.25)\). Compare the prior \(b\sim N(0,1)\) with a mixture prior \(0.9N(0,1)+0.1N(0,9)\). These are hypothetical numbers for illustrating prior sensitivity; the summary likelihood is a simplified stand-in for information about a random effect in a joint model.

Gaussian prior. With prior variance \(1\), normal conjugacy gives posterior variance \(1(0.25)/(1+0.25)=0.2\), and posterior mean \(1/(1+0.25)\times 3=2.4\). Thus \(b\mid y\sim N(2.4,0.2)\), with posterior standard deviation \(\sqrt{0.2}=0.4472\).

Mixture prior. For each prior component, the marginal distribution of \(y\) is normal with variance equal to the component variance plus \(0.25\). The unnormalized posterior weights are therefore \(0.9\phi(3;0,1.25)\) and \(0.1\phi(3;0,9.25)\), where \(\phi(y;\mu,v)\) is the normal density with mean \(\mu\) and variance \(v\). Evaluating these gives approximately \(0.0087748\) and \(0.0080642\), respectively. The posterior probability of the broad component is

$$ \frac{0.1\phi(3;0,9.25)} {0.9\phi(3;0,1.25)+0.1\phi(3;0,9.25)} = \frac{0.0080642}{0.0087748+0.0080642} \approx 0.479. $$

Within the narrow component the posterior mean and variance are \(2.4\) and \(0.2\), as above. Within the broad component they are \((9/9.25)3=2.9189\) and \(9(0.25)/9.25=0.2432\). The overall posterior mean is the weighted mean of the component means:

$$ (1-0.479)\,2.4+0.479(2.9189)\approx 2.649. $$

The mixture permits more weight on a broad component when the observation is far from zero, so the posterior mean is less strongly pulled toward zero than under the single Gaussian prior. This calculation illustrates a mechanism, not a general direction of change in a joint model: the event likelihood and other random-effect dimensions can alter the result.

Justifying scale matching and examining tail behavior

Matching covariance helps separate a change in shape from a simple increase in prior variability. For a Student-\(t\) alternative, the scale adjustment follows directly from its variance. If \(U\sim t_\nu(0,1)\), then \(\operatorname{Var}(U)=\nu/(\nu-2)\) for \(\nu>2\). Thus, for a desired variance of one, \(b=\sqrt{(\nu-2)/\nu}\,U\) has variance one. If \(\nu\leq2\), the variance does not exist, so matching it is impossible; the prior must instead be calibrated using another feature, such as a central quantile or prior-predictive range.

Worked Example: Comparing tail probabilities at equal variance

Compare a standard normal random effect with a Student-\(t\) random effect having \(\nu=4\) and variance one. The required \(t\) scale is \(\sqrt{(4-2)/4}=0.7071\), so \(b=0.7071U\), where \(U\sim t_4\). The event \(|b|>2\) is equivalent to \(|U|>2/0.7071=2.828\).

For a \(t_4\) variable, its two-sided tail probability at \(x\) can be written as \(2S(x)\), where

$$ S(x)=\frac{3}{4}\left[ \frac{2}{3}-\frac{x}{\sqrt{x^2+4}} +\frac{1}{3}\left(\frac{x}{\sqrt{x^2+4}}\right)^3 \right]. $$

At \(x=2.828\), \(x/\sqrt{x^2+4}\approx0.8165\), giving \(2S(x)\approx0.0474\). For \(b\sim N(0,1)\), \(P(|b|>2)\approx0.0455\). The matched-variance \(t_4\) prior has a somewhat greater probability beyond two standard deviations in this example. This tail comparison describes the priors; it does not by itself establish that the fitted joint model will produce a particular posterior change.

In a full model, prior-predictive checks provide another scale check. Draw random effects and other parameters from their priors, then examine the implied longitudinal trajectories and survival patterns before conditioning on the observed data. A distribution that assigns substantial probability to implausible marker values or hazards is not a useful “robust” alternative simply because it has heavy tails.

How to conduct and interpret the sensitivity analysis

Fit the baseline and alternative specifications using the same observed data and the same structural model. For each fit, assess the chains using the usual convergence and Monte Carlo diagnostics. Poor mixing in one model can make apparent differences reflect computational error rather than distributional sensitivity. Compare posterior summaries and relevant predictions on a common scale, reporting posterior intervals and Monte Carlo precision where appropriate.

1
Choose a defensible baseline and alternatives.
Specify the Gaussian model and one or more alternatives, such as a variance-matched Student-\(t\) or a justified mixture. State which aspects are matched and which are intentionally changed.
2
Fit each model and check computation.
Use comparable fitting settings, then examine chain behavior, effective sample size, and Monte Carlo error for the parameters and predictions being compared.
3
Compare scientifically relevant inferences.
Check posterior summaries for \(D\), \(\alpha\), regression effects, and survival quantities at meaningful covariate profiles or times. Focus on changes that could affect interpretation or decisions.
4
Report the scope of robustness.
Describe which conclusions remain similar and which are sensitive. Do not treat a small change in a posterior mean alone as proof of robustness if tail probabilities or predictions change materially.

A useful report can place the posterior median and interval for \(\alpha\), for example, beside a survival probability at a specified time under each random-effects distribution. If the association estimate shifts while predictions remain similar, say so; if predictions differ, report the time horizon and covariate profile. The interpretation is conditional on each model specification. It is not a frequentist significance test between distributions, nor does it assign a probability that one distributional assumption is correct.

Worked Example: Translating posterior changes to a survival prediction

Worked Example: Translating posterior changes to a survival prediction

Suppose two hypothetical fitted models give different posterior summaries for a subject whose marker trajectory is one unit above the reference trajectory at time \(t\). Assume, for illustration, that the posterior mean of \(\alpha\) is \(0.40\) under the Gaussian random-effects model and \(0.55\) under a heavy-tailed alternative. The event-model association is \(h_i(t\mid b_i)=h_0(t)\exp\{\alpha m_i(t;b_i)\}\), so the conditional hazard ratio for a one-unit increase in the marker is \(\exp(\alpha)\).

Under the Gaussian specification, the ratio is \(\exp(0.40)\approx1.492\). Under the alternative, it is \(\exp(0.55)\approx1.733\). Thus the conditional hazard ratio is about 1.49 versus 1.73 per one-unit higher marker value, given the modeled trajectory and other covariates. The difference is potentially consequential, but these are hypothetical posterior means and do not include interval uncertainty.

This calculation is not itself a marginal survival prediction: marginal predictions must average over uncertainty in the random effects and model parameters. It also does not establish a causal effect. It demonstrates why an association parameter can be a meaningful sensitivity target and why reporting only the random-effects variance may miss changes in the scientific conclusion.

Diagnostics, alternatives, and limitations

Distributional sensitivity is most informative when the observed data provide limited information about the tails of the random-effects distribution. Subjects with few longitudinal measurements or little event follow-up may have effects that are largely informed by the population distribution. In such settings, the prior shape can influence shrinkage and the shared association. Conversely, apparent insensitivity does not prove Gaussianity: the available data may simply be unable to distinguish plausible alternatives.

Check for warning signs in both the fitted model and its implications. Extremely influential subjects, major changes in posterior random effects for a few individuals, or large shifts in \(\alpha\) or survival predictions merit investigation. Compare prior-predictive trajectories and event patterns, and inspect posterior random-effects distributions and extreme values. These checks should be interpreted alongside chain diagnostics; a poorly mixing chain can imitate or obscure sensitivity. Posterior predictive checks assess whether fitted models reproduce relevant data features, but they do not automatically resolve which random-effects distribution should be used.

ApproachWhat it changesMain caution
Gaussian random effectsBaseline location and covariance structure with Gaussian shapeCan underrepresent tail behavior or population subgroups
Variance-matched Student-\(t\)Allows heavier tails while retaining the chosen covariance when \(\nu>2\)Degrees of freedom and scale need justification; low degrees of freedom can make variance undefined
Finite Gaussian mixtureAllows distinct components with different scales or locationsMixture weights and components can be weakly identified and sensitive to their priors
Robust prior on covariance parametersChanges prior regularization of the covariance, not necessarily the distributional shape of \(b_i\)It is not equivalent to replacing Gaussian random effects with a heavy-tailed distribution

These approaches answer related but distinct questions. A robust prior on \(D\) can reduce undue influence from restrictive covariance priors while leaving \(b_i\mid D\) Gaussian. A Student-\(t\) or mixture changes the distributional shape itself. Sensitivity comparisons are also limited by the set of alternatives considered, prior calibration, and model structure held fixed. If all specifications share a misspecified longitudinal trajectory or event association, agreement among them cannot correct that structural problem.

Common pitfall

Common mistake: “The \(t\) model has heavier tails, so I gave it the same scale matrix as the Gaussian model; any posterior difference must be due only to tail shape.” This reasoning is incorrect because a Student-\(t\) scale matrix is not its covariance matrix. For \(\nu>2\), its covariance is \(\nu S/(\nu-2)\), so using the same scale as a Gaussian generally changes both tail shape and variance. Match covariance using \(S=(\nu-2)D/\nu\), or state clearly that the scale rather than covariance is being held fixed.

The practical lesson is to report the parameterization and calibration of every alternative. Then distinguish changes in prior spread from changes in shape, and describe posterior differences as sensitivity to the stated modeling choices rather than evidence that one choice is correct.

Check Your Understanding

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

  1. For a Student-\(t\) random effect with \(\nu=5\), what scale matrix gives covariance \(D\)?
  2. Why is a mixture prior not interchangeable with a variance-matched Student-\(t\) prior?
  3. In a sensitivity analysis, the posterior mean of \(\alpha\) changes little, but the predicted survival probability at a clinically relevant time changes substantially. Is it appropriate to call the results robust?
  4. Why should chain diagnostics be checked separately for each distributional specification?

Solutions. (1) Use \(S=(\nu-2)D/\nu\), giving \(S=3D/5\). (2) A mixture allows probability to be allocated among components with distinct scales or locations; a Student-\(t\) has a different continuous tail shape. Equal covariance does not make their distributions equivalent. (3) No. Robustness should be judged for the relevant predictions as well as parameter summaries; the substantial prediction change should be reported with its time horizon and context. (4) Different distributions can produce different posterior geometry and mixing behavior. Without adequate convergence and Monte Carlo precision in each fit, apparent differences or similarities may reflect computational error.

Clinical Biostats