The equation highlighted below is the fundamental likelihood function for joint models. This document breaks it down piece by piece.
\[ p(y_i, T_i, \delta_i) = \int p(y_i \mid b_i) \left\{ h(T_i \mid b_i)^{\delta_i} S(T_i \mid b_i) \right\} p(b_i)\,db_i \]
This is the joint likelihood for a single patient \(i\).
It gives the probability of observing both:
The key idea is that both processes depend on the same underlying random effects \(b_i\), which represent the patient’s true underlying health trajectory.
This is the probability of observing the patient’s longitudinal measurements, given their random effects.
In words:
If we know the patient’s true underlying trajectory, represented by \(b_i\), how likely are we to observe the measurements that were actually recorded?
For normally distributed longitudinal data:
\[ p(y_i \mid b_i) = \prod_{j=1}^{n_i} \frac{1}{\sqrt{2\pi\sigma^2}} \exp \left\{ -\frac{ \left( y_{ij} - x_{ij}^{\top}\beta - z_{ij}^{\top}b_i \right)^2 }{ 2\sigma^2 } \right\} \]
This is the likelihood contribution from the linear mixed-effects model. It describes how well the model, including the patient’s random effects, fits the observed longitudinal measurements such as CD4 counts or bilirubin levels.
This is the survival likelihood contribution.
It represents the probability of observing the patient’s survival outcome.
If the patient experienced the event, so that \(\delta_i = 1\),
\[ h(T_i \mid b_i)^{1} = h(T_i \mid b_i) \]
and the likelihood includes the hazard at the event time.
If the patient was censored, so that \(\delta_i = 0\),
\[ h(T_i \mid b_i)^{0} = 1 \]
and there is no hazard contribution because the event was not observed.
A common form of the hazard function is
\[ h(T_i \mid b_i) = h_0(T_i) \exp \left\{ \gamma^{\top}w_i + \alpha m_i(T_i) \right\} \]
where
\[ m_i(T_i) = x_i^{\top}(T_i)\beta + z_i^{\top}(T_i)b_i. \]
The hazard at time \(T_i\) depends on:
Crucially, \(m_i(T_i)\) depends on \(b_i\), which links the survival process to the longitudinal process.
This is the survival probability: the probability that the patient survives up to time \(T_i\).
\[ S(T_i \mid b_i) = \exp \left\{ - \int_0^{T_i} h(s \mid b_i)\,ds \right\} \]
Substituting the hazard model gives
\[ S(T_i \mid b_i) = \exp \left\{ - \int_0^{T_i} h_0(s) \exp \left[ \gamma^{\top}w_i + \alpha m_i(s) \right] \,ds \right\}. \]
This survival probability accounts for:
Again, \(m_i(s)\) depends on \(b_i\), so the survival process remains linked to the longitudinal process.
This is the probability distribution of the random effects.
For multivariate normally distributed random effects,
\[ p(b_i) = (2\pi)^{-k/2} |D|^{-1/2} \exp \left\{ -\frac{1}{2} b_i^{\top} D^{-1} b_i \right\}, \]
where \(k\) is the number of random effects, for example \(k=2\) for a random intercept and a random slope.
This distribution describes:
\[ \int \cdots db_i \]
The random effects \(b_i\) are unobserved latent variables. We do not know each patient’s exact random effects.
Therefore, the model integrates over all possible values of \(b_i\).
Conceptually, we:
Putting everything together,
\[ \begin{aligned} p(y_i, T_i, \delta_i) = \int &\left[ \prod_{j=1}^{n_i} \frac{1}{\sqrt{2\pi\sigma^2}} \exp \left\{ -\frac{ \left( y_{ij} - x_{ij}^{\top}\beta - z_{ij}^{\top}b_i \right)^2 }{ 2\sigma^2 } \right\} \right] \\[6pt] &\times \left[ h_0(T_i) \exp \left\{ \gamma^{\top}w_i + \alpha \left( x_i^{\top}(T_i)\beta + z_i^{\top}(T_i)b_i \right) \right\} \right]^{\delta_i} \\[6pt] &\times \exp \left\{ - \int_0^{T_i} h_0(s) \exp \left[ \gamma^{\top}w_i + \alpha \left( x_i^{\top}(s)\beta + z_i^{\top}(s)b_i \right) \right] \,ds \right\} \\[6pt] &\times (2\pi)^{-k/2} |D|^{-1/2} \exp \left\{ -\frac{1}{2} b_i^{\top} D^{-1} b_i \right\} \,db_i. \end{aligned} \]
| Component | What it represents | Role in the model |
|---|---|---|
| \(b_i\) | True underlying health trajectory | Latent variable linking the longitudinal and survival processes |
| \(p(y_i \mid b_i)\) | Longitudinal likelihood | Measures how well the patient’s trajectory fits the observed longitudinal data |
| \(h(T_i \mid b_i)^{\delta_i}S(T_i \mid b_i)\) | Survival likelihood | Measures how likely the observed survival outcome is, given the patient’s trajectory |
| \(p(b_i)\) | Random-effects distribution | Describes how likely a particular trajectory is in the population |
| \(\int \cdots db_i\) | Integration over random effects | Averages over all possible latent trajectories |
For the AIDS data, consider the following joint model.
\[ y_i(t) = \beta_0 + \beta_1 t + \beta_2(t \times ddI_i) + b_{i0} + b_{i1}t + \varepsilon_i(t). \]
\[ h_i(t) = h_0(t) \exp \left\{ \gamma \times ddI_i + \alpha \left[ \beta_0 + \beta_1 t + \beta_2(t \times ddI_i) + b_{i0} + b_{i1}t \right] \right\}. \]
\[ b_i = \begin{pmatrix} b_{i0} \\ b_{i1} \end{pmatrix} \sim N(0,D). \]
\[ p(y_i, T_i, \delta_i) = \int p(y_i \mid b_{i0}, b_{i1}) \left\{ h(T_i \mid b_{i0}, b_{i1})^{\delta_i} S(T_i \mid b_{i0}, b_{i1}) \right\} p(b_{i0}, b_{i1}) \,db_{i0}\,db_{i1}. \]
The random effects \(b_i\) appear in both the longitudinal model and the survival model.
This is what creates the association between the two processes.
For example, a patient with a high random intercept \(b_{i0}\) may have:
A patient with a negative random slope \(b_{i1}\) may have:
We do not know the true \(b_i\) for each patient.
By integrating over all possible values of \(b_i\), the joint model:
Given \(b_i\), the longitudinal and survival processes are assumed to be conditionally independent:
\[ p(y_i, T_i, \delta_i \mid b_i) = p(y_i \mid b_i) \times p(T_i, \delta_i \mid b_i). \]
This is why the joint likelihood factorizes in this way.
All dependence between the longitudinal and survival processes is captured through the shared random effects \(b_i\).
A time-dependent Cox model effectively works with a factorization such as
\[ p(y_i, T_i, \delta_i) \approx p(T_i, \delta_i \mid y_i) \times p(y_i). \]
It conditions directly on the observed longitudinal values \(y_i\), often treating them as if they were known without measurement error.
This can ignore:
The joint model instead uses
\[ p(y_i, T_i, \delta_i) = \int p(y_i \mid b_i) \times p(T_i, \delta_i \mid b_i) \times p(b_i) \,db_i. \]
This allows the model to account explicitly for measurement error and the shared latent structure.
| Concept | Explanation |
|---|---|
| \(p(y_i \mid b_i)\) | Likelihood of the observed longitudinal data |
| \(h(T_i \mid b_i)^{\delta_i}\) | Hazard contribution at the event time, if the event occurred |
| \(S(T_i \mid b_i)\) | Probability of surviving up to the observed time |
| \(p(b_i)\) | Distribution of random effects in the population |
| \(\int \cdots db_i\) | Averages over all possible values of the random effects |
| Key insight | Shared random effects link the longitudinal and survival processes and explain their dependence |
\[y_i(t) = m_i(t) + \varepsilon_i(t)\]
where:
\[m_i(t) = x_i^\top(t)\beta + z_i^\top(t)b_i\]
and:
\[\varepsilon_i(t) \sim N(0, \sigma^2).\]
\[h_i(t \mid \mathcal{M}_i(t)) = h_0(t) \exp\{\gamma^\top w_i + \alpha m_i(t)\}\]
where \(\mathcal{M}_i(t) = \{m_i(s), 0 \le s < t\}\) is the marker history.
The sub-models are linked through:
\[y_i(t) = \beta_0 + \beta_1 t + \beta_2 (t \times ddI_i) + b_{i0} + b_{i1} t + \varepsilon_i(t).\]
\[h_i(t) = h_0(t) \exp\{\gamma \times ddI_i + \alpha[\beta_0 + \beta_1 t + \beta_2 (t \times ddI_i) + b_{i0} + b_{i1} t]\}.\]
\[b_i = \begin{pmatrix} b_{i0} \\ b_{i1} \end{pmatrix} \sim N(0, D).\]
\[p(y_i, T_i, \delta_i) = \int p(y_i \mid b_{i0}, b_{i1}) \{h(T_i \mid b_{i0}, b_{i1})^{\delta_i} S(T_i \mid b_{i0}, b_{i1})\} p(b_{i0}, b_{i1}) \, db_{i0} \, db_{i1}.\]
| Parameter | Meaning | Example (AIDS Data) |
|---|---|---|
| \(\beta_0\) | Baseline marker value | Baseline CD4 count |
| \(\beta_1\) | Rate of change over time | CD4 decline per month |
| \(\sigma^2\) | Measurement error variance | Variability in CD4 measurements |
| Parameter | Meaning | Example (AIDS Data) |
|---|---|---|
| \(\gamma\) | Treatment effect on survival | ddI effect on death hazard |
| \(\alpha\) | Association parameter | CD4 effect on death hazard |
| \(h_0(t)\) | Baseline hazard | Underlying death risk |
| Parameter | Meaning | Example (AIDS Data) |
|---|---|---|
| \(D_{11}\) | Variance of random intercept | Variation in baseline CD4 |
| \(D_{22}\) | Variance of random slope | Variation in CD4 decline |
| \(D_{12}\) | Covariance between intercept and slope | Correlation between baseline and decline |
In the survival sub-model:
\[h_i(t \mid \mathcal{M}_i(t)) = h_0(t) \exp\{\gamma^\top w_i + \alpha m_i(t)\}\]
\(\gamma^\top w_i\) represents the linear combination of baseline covariates (fixed effects) that affect the hazard function:
Example from the AIDS Data:
\[h_i(t) = h_0(t) \exp\{\gamma \times ddI_i + \alpha[\text{CD4 trajectory}]\}\]
Here: - \(w_i\) = \(ddI_i\) (treatment indicator: whether patient received ddI or placebo) - \(\gamma\) = the treatment effect on survival hazard
What it represents:
| Component | Interpretation |
|---|---|
| \(w_i\) | Baseline characteristics that don’t change over time (e.g., treatment group, gender, age at baseline) |
| \(\gamma\) | How much each baseline characteristic shifts the log-hazard |
| \(\exp(\gamma^\top w_i)\) | The multiplicative effect of these covariates on the hazard |
Note on notation: - \(\gamma^\top w_i\) (with a gamma) = survival model fixed effects - \(\beta^\top x_i(t)\) (with a beta) = longitudinal model fixed effects
\(m_i(t)\) represents the true underlying CD4 trajectory for patient \(i\) at time \(t\).
Distinction between observed and true values:
| Component | Role | Example |
|---|---|---|
| \(y_i(t)\) | Observed CD4 | The CD4 value you see in the medical record (e.g., 450 cells/mm³) |
| \(m_i(t)\) | True CD4 | The patient’s actual CD4 level (unobserved, e.g., 455 cells/mm³) |
| \(\varepsilon_i(t)\) | Measurement error | The difference between observed and true (e.g., -5 cells/mm³ due to lab variability) |
Why we use \(m_i(t)\) in the survival model:
Interpretation of \(\alpha\) in the AIDS context:
So in the AIDS example, \(m_i(t)\) is the latent (true) CD4 trajectory that drives both the observed CD4 measurements AND the survival process!
The random effects \(b_i\) appear in both models, creating the association:
By integrating over \(b_i\), the model:
Given \(b_i\):
\[p(y_i, T_i, \delta_i \mid b_i) = p(y_i \mid b_i) \times p(T_i, \delta_i \mid b_i)\]
All dependence is captured through the shared random effects.
The time-dependent Cox model conditions on observed \(y_i\):
\[p(y_i, T_i, \delta_i) \approx p(T_i, \delta_i \mid y_i) \times p(y_i)\]
This ignores measurement error and the shared latent structure.
The joint model correctly handles this:
\[p(y_i, T_i, \delta_i) = \int p(y_i \mid b_i) \times p(T_i, \delta_i \mid b_i) \times p(b_i) \, db_i.\]