Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Bayesian Covariance Priors For Multiple Markers

Multiple Longitudinal Markers · Tutorial 389 of 697

Bayesian Covariance Priors For Multiple Markers

You will learn to construct and check Bayesian priors for multimarker covariance structures and understand how those choices influence joint-model estimates.

Advanced 12 min read

What You'll Learn

  • Distinguish random-effect covariance from residual covariance in a multimarker longitudinal model.
  • Parameterize covariance matrices using standard deviations and correlation matrices.
  • Interpret half-t priors for scales and LKJ priors for correlations.
  • Calculate how covariance choices affect marker contrasts and survival linear predictors.
  • Compare separated covariance priors with inverse-Wishart priors and identify practical diagnostics.

Why Covariance Priors Matter

In a multimarker joint model, each marker can have its own random intercepts and slopes, and those subject-specific effects may be correlated across markers. Measurement errors from different markers may also be correlated at the same visit. These covariance structures help determine how information is shared across markers: they influence estimated subject trajectories, uncertainty in those trajectories, and consequently the survival association estimates that depend on them.

A covariance prior is not just a technical device for making estimation possible. With many markers, the number of variances and correlations can grow quickly, while the data may provide limited information about some of them. Prior choices therefore affect regularization and can matter for inference, especially when markers are highly correlated or sparsely observed.

Separate the Covariance Structures

Let \(Y_i(t)\) be the vector of \(K\) marker measurements for subject \(i\) at time \(t\). A simple longitudinal model is

$$ Y_i(t)=\mu_i(t)+Z_i(t)b_i+\varepsilon_i(t). $$

Here \(\mu_i(t)\) denotes the fixed-effects mean, \(b_i\) is a vector of subject-specific random effects, \(Z_i(t)\) maps those effects to the marker measurements, and \(\varepsilon_i(t)\) is the residual measurement error. In a joint model, the event-time component may condition on latent marker trajectories derived from this longitudinal model. The covariance of \(b_i\) and that of \(\varepsilon_i(t)\) are different parameters with different interpretations.

Definition: A covariance matrix is symmetric and positive semidefinite: for every vector \(a\), \(a^\mathsf{T}\Sigma a\geq 0\). Its diagonal entries are variances and its off-diagonal entries are covariances. A correlation matrix is a covariance matrix with unit diagonal, so it too must be positive semidefinite. A model or prior may specifically require positive definiteness, which is stronger: \(a^\mathsf{T}\Sigma a>0\) for every nonzero \(a\). Many continuous covariance-prior parameterizations assign probability only to positive-definite matrices; this does not change the general positive-semidefinite requirement for a valid covariance matrix.

For example, if \(b_i\) stacks a random intercept and slope for each of several markers, its covariance matrix \(D\) describes between-subject variation and association in those latent effects. A residual covariance matrix \(R\) can instead describe contemporaneous measurement-error association across markers after conditioning on the modeled trajectories. If residual errors are assumed independent across markers, \(R\) is diagonal. A separate serial residual model may be needed if errors from different visits remain associated; a same-visit cross-marker matrix alone does not specify temporal dependence.

A Separated Prior for Scales and Correlations

A common construction separates the standard deviations from the correlation matrix. For a \(q\)-dimensional random-effect vector, write

$$ D=S\Omega S,\qquad S=\operatorname{diag}(\tau_1,\ldots,\tau_q), $$

where \(\tau_j>0\) is the standard deviation of random effect \(j\), and \(\Omega\) is a \(q\times q\) correlation matrix. Thus \(D_{jj}=\tau_j^2\) and \(D_{jk}=\tau_j\tau_k\Omega_{jk}\). The same separation can be used for a positive-definite residual covariance matrix, with residual standard deviations in \(S\) and residual correlations in \(\Omega\).

One possible scale prior is \(\tau_j\sim\text{half-}t_\nu(0,A_j)\): a Student \(t\) distribution with \(\nu\) degrees of freedom and scale \(A_j\), restricted to positive values. The scale \(A_j\) must be meaningful in the units of random effect \(j\); a random slope measured per year and a random intercept measured in marker units need not use the same scale. Other choices, such as half-normal priors, are also possible. The essential practice is to state the scale and check that it allows plausible variation without placing substantial prior mass on implausibly large values.

A standard correlation prior is the LKJ prior. For a positive-definite correlation matrix \(\Omega\), its density is proportional to \(|\Omega|^{\eta-1}\), where \(\eta>0\) is the shape parameter. At \(\eta=1\), the density is constant over the space of positive-definite correlation matrices. Values \(\eta>1\) increasingly favor matrices nearer the identity; values \(0<\eta<1\) put relatively more density near the boundary. This is a joint distribution on the matrix, not a collection of independently specified pairwise correlations: the entries must form a valid correlation matrix.

Worked Example: Turning Standard Deviations and a Correlation Into a Covariance

Suppose two marker-specific random intercepts have standard deviations \(\tau_1=0.4\) marker units and \(\tau_2=0.6\) marker units, with correlation \(0.5\). Their covariance matrix is obtained from \(D=S\Omega S\), where

$$ S= \begin{pmatrix}0.4&0\\0&0.6\end{pmatrix}, \qquad \Omega= \begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}. $$

The diagonal variances are \(0.4^2=0.16\) and \(0.6^2=0.36\), in squared marker units. The off-diagonal covariance is \(0.4(0.6)(0.5)=0.12\), in the product of the two marker units. Therefore,

$$ D= \begin{pmatrix}0.16&0.12\\0.12&0.36\end{pmatrix}. $$

The correlation matrix is positive definite because its determinant is \(1-0.5^2=0.75>0\), and its diagonal entries are positive. This prior specification says that subjects with higher-than-average random intercepts for the first marker tend, on average, to have higher-than-average random intercepts for the second. It does not assert that the markers’ observed values or residual errors have the same correlation.

What the Correlation Prior Implies

The LKJ prior’s behavior can be seen explicitly for two markers. Their correlation matrix has the form

$$ \Omega= \begin{pmatrix}1&\rho\\\rho&1\end{pmatrix}, \qquad -1<\rho<1, $$

and determinant \(1-\rho^2\). Thus the marginal density for \(\rho\) under the two-dimensional LKJ prior is proportional to \((1-\rho^2)^{\eta-1}\). Normalizing it gives

$$ f(\rho)= \frac{\Gamma(\eta+\tfrac12)} {\sqrt{\pi}\,\Gamma(\eta)} (1-\rho^2)^{\eta-1},\qquad -1<\rho<1. $$

The normalizing constant follows because the integral of \((1-\rho^2)^{\eta-1}\) from \(-1\) to \(1\) is \(B(\tfrac12,\eta)=\sqrt{\pi}\Gamma(\eta)/\Gamma(\eta+\tfrac12)\). This calculation also shows why a uniform prior on each correlation is not a general solution for a matrix with three or more variables: arbitrary pairwise values may fail to define a positive-semidefinite matrix.

Worked Example: A Two-Marker LKJ Prior Probability

Suppose the two-dimensional correlation matrix for two random intercepts has an LKJ prior with \(\eta=2\). The density is \(f(\rho)=\frac34(1-\rho^2)\) for \(-1<\rho<1\), since \(\Gamma(2.5)/[\sqrt{\pi}\Gamma(2)]=3/4\). To find the prior probability that the correlation lies between \(-0.5\) and \(0.5\), integrate:

$$ P(|\rho|<0.5) =\int_{-0.5}^{0.5}\frac34(1-\rho^2)\,d\rho =\frac34\left[\,\rho-\frac{\rho^3}{3}\,\right]_{-0.5}^{0.5} =\frac34\left(\frac{11}{12}\right) =0.6875. $$

Before seeing data, this prior assigns 68.75% probability to a random-intercept correlation between \(-0.5\) and \(0.5\), and 31.25% to values outside that interval. It is not a statement about the posterior probability after observing the longitudinal and survival data. For comparison, at \(\eta=1\) the two-dimensional prior is uniform on \((-1,1)\), so the same interval has prior probability \(0.5\).

How Covariance Choices Affect Survival Inference

Suppose a subject-specific log hazard contains a weighted combination of two latent marker values, \(g_i(t)=\alpha_1m_{i1}(t)+\alpha_2m_{i2}(t)\), where \(\alpha_1\) and \(\alpha_2\) are marker association coefficients. If uncertainty in those marker values is represented by variances \(v_1,v_2\) and covariance \(c_{12}\), then the variance of the weighted combination is

$$ \operatorname{Var}\{g_i(t)\} =\alpha_1^2v_1+\alpha_2^2v_2+2\alpha_1\alpha_2c_{12}. $$

This identity follows by expanding the variance of a linear combination and using \(\operatorname{Cov}(m_{i1},m_{i2})=c_{12}\). It makes clear that cross-marker covariance can increase or decrease uncertainty in a hazard predictor, depending on the signs of the weights and covariance. The formula concerns uncertainty in the weighted latent values; it is not by itself a formula for the marginal hazard, which also involves the nonlinear exponential link and integration over latent quantities.

Worked Example: Covariance and Uncertainty in a Survival Predictor

Assume two latent marker values have variances \(v_1=0.16\) and \(v_2=0.36\), and covariance \(c_{12}=0.12\), as in the preceding covariance calculation. Let their survival association coefficients be \(\alpha_1=0.5\) and \(\alpha_2=-0.4\), per marker unit. Then

$$ \operatorname{Var}(g_i(t)) =(0.5)^2(0.16)+(-0.4)^2(0.36) +2(0.5)(-0.4)(0.12) =0.040+0.0576-0.048 =0.0496. $$

The standard deviation of this weighted latent contribution is \(\sqrt{0.0496}=0.2227\) log-hazard units. If the covariance were incorrectly set to zero while keeping the same variances and coefficients, the variance would be \(0.040+0.0576=0.0976\), with standard deviation \(0.3124\) log-hazard units. Here, positive cross-marker covariance reduces uncertainty because the association coefficients have opposite signs. This calculation illustrates a possible pathway by which covariance priors influence survival inference; a fitted model’s posterior also reflects observed data, fixed effects, and event-time information.

Choosing and Checking Covariance Priors

The separated scale-and-correlation construction is often useful because it makes the prior’s components interpretable and permits scale choices in the measurement units. It does not eliminate the need for careful modeling. In particular, the random-effect covariance and residual covariance should each be specified according to the scientific and measurement structure, rather than assigned the same matrix automatically.

An inverse-Wishart prior is a traditional prior for a whole covariance matrix. It can be convenient, but its degrees-of-freedom and scale parameters jointly affect variances and correlations. As a result, apparently simple choices can induce unexpected marginal priors on standard deviations or correlations. The separated construction makes these components more directly controllable, though it also requires specifying scale priors and a correlation prior. Neither construction repairs a likelihood that cannot distinguish random-effect variation from residual variation.

Before fitting, check the following:

  • Units and scaling. The prior scales for standard deviations should match the units of the corresponding intercepts, slopes, or residuals. Centering time and scaling markers can make these choices easier to interpret.
  • Matrix validity. The implied covariance and correlation matrices must be symmetric and positive semidefinite. A positive-definite parameterization ensures nonsingularity, but singular covariance matrices remain valid mathematical covariance matrices.
  • Prior predictive behavior. Simulate standard deviations, correlation matrices, longitudinal trajectories, and implied survival predictors from the prior. Check whether these quantities are scientifically plausible before conditioning on data.
  • Posterior behavior. Inspect trace plots, effective sample sizes, convergence diagnostics, and posterior summaries for standard deviations and important correlations. Strong concentration near a singular boundary or poor mixing can signal weak information or difficult geometry.
  • Sensitivity. Refit with scientifically defensible alternatives for the scale priors or LKJ shape parameter. Material changes in association estimates or uncertainty indicate that covariance assumptions matter to the conclusions.

When markers are strongly collinear or some subjects have few measurements, their covariance components may be weakly identified. A posterior correlation near zero does not establish conditional independence, and a broad posterior should not be summarized as a precise absence of association. Likewise, a prior favoring the identity matrix can stabilize estimation but may understate real cross-marker dependence if chosen too strongly.

Common Pitfalls and Limits

  • Calling every valid covariance matrix positive definite. The general validity condition is positive semidefiniteness. Positive definiteness is an additional nonsingularity condition that many prior parameterizations impose.
  • Confusing random-effect and residual correlations. Correlated subject-specific trajectories do not imply correlated measurement errors, and vice versa. They represent different sources of dependence.
  • Assigning independent priors to all pairwise correlations. In dimensions greater than two, separately plausible correlation values may not form a valid correlation matrix. Use a joint matrix prior or another construction that enforces matrix validity.
  • Interpreting the prior as data evidence. A prior preference for modest correlations is a modeling choice, not an empirical finding. Report the prior and examine its influence on posterior inference.

Covariance priors cannot resolve fundamental lack of information. If measurements are sparse, markers nearly redundant, or the longitudinal design provides little slope information, posterior covariance estimates can remain prior-sensitive. Priors also do not substitute for appropriate residual structure, model checks, or a clear account of which latent marker features enter the survival model.

Key takeaway: Specify covariance priors by distinguishing variability in latent subject effects from measurement error, expressing each matrix through interpretable scales and a jointly valid correlation structure, and checking prior predictive and posterior sensitivity. Covariance assumptions can alter uncertainty in multimarker hazard predictors and therefore deserve explicit justification.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A two-marker random-intercept correlation is \(0.8\). Is the corresponding \(2\times2\) correlation matrix positive definite? Give the determinant.
  2. For two random effects with standard deviations \(0.3\) and \(0.5\), and correlation \(-0.4\), calculate their covariance.
  3. Why can pairwise independent priors on all correlations be problematic with three or more markers?
  4. In a joint model, what is the distinction between random-effect covariance and residual covariance?

Solutions. (1) The matrix is \(\begin{pmatrix}1&0.8\\0.8&1\end{pmatrix}\), whose determinant is \(1-0.8^2=0.36>0\); its diagonal entries are positive, so it is positive definite. (2) The covariance is \(0.3(0.5)(-0.4)=-0.06\), in the product of the two random-effect units. (3) Arbitrary pairwise correlations need not jointly form a positive-semidefinite matrix, so independent choices can assign probability to invalid correlation structures. (4) Random-effect covariance describes association among subjects’ latent deviations, whereas residual covariance describes association among measurement errors conditional on the modeled trajectories.

Clinical Biostats