Why Factor the Posterior?
In a shared-random-effects joint model, repeated measurements and an event time inform one another through latent subject-specific effects. Writing the posterior as a product makes the source of each contribution explicit: the longitudinal likelihood describes the repeated measurements, the survival likelihood describes the event or censoring information, the random-effects density describes the latent effects, and the parameter prior describes uncertainty about model parameters. This separation is useful for checking a model’s algebra and understanding how the two data sources jointly update the latent effects and shared parameters.
The factorization is an identity under the specified model and its conditional-independence assumptions. It is not a claim that the longitudinal and survival data are independent after the random effects have been integrated out, nor does it imply that each factor can be estimated in isolation.
Model and Posterior Factorization
For subject \(i=1,\ldots,n\), let \(Y_i=(Y_{i1},\ldots,Y_{in_i})\) denote the observed longitudinal measurements at times \(t_{ij}\). Let \(T_i\) be the observed event or censoring time and \(\delta_i\) the event indicator, equal to 1 for an observed event and 0 for right censoring. Let \(b_i\) be the subject-specific random-effects vector. Write \(\theta\) for the model parameters other than the subject-specific random effects; these may include longitudinal fixed effects, residual variation, random-effects covariance parameters, survival parameters, and association parameters.
A typical longitudinal model specifies a conditional mean \(m_i(t;\theta,b_i)\) and a conditional density for each measurement. A typical survival model specifies the hazard \(h_i(t\mid\theta,b_i)\) and cumulative hazard \(H_i(t\mid\theta,b_i)=\int_0^t h_i(u\mid\theta,b_i)\,du\). For right-censored event-time data, the survival contribution is the event density when \(\delta_i=1\), and the survival probability when \(\delta_i=0\). Both cases can be written in one expression.
The proportionality constant is the marginal density of all observed data under the model. It does not depend on \(\theta\) or the \(b_i\), so it can be omitted when specifying the posterior kernel. The posterior itself is normalized: its density integrates to one over the parameter and random-effects space. The factor \(p(\theta)\) need not be a product of separate priors. It can be factored further only when the specified prior structure justifies doing so.
The usual likelihood expression also assumes that the measurement process and censoring mechanism can be ignored for the stated inference, or that they have been modeled appropriately. In particular, the survival contribution above handles right censoring under the model’s censoring assumptions; it is not a general likelihood for every possible censoring or observation process.
Why the Product Is Valid
The factorization follows from the chain rule for densities together with the model’s conditional-independence assumptions. Conditional on \(\theta\) and all random effects, the data from different subjects are independent. Within a subject, conditional on \(\theta\) and \(b_i\), the longitudinal outcomes and survival outcome are independent. Thus the conditional data density is a product of longitudinal and survival densities within each subject, and a product across subjects. Multiplying this likelihood by the prior density \(p(\theta)\prod_i p(b_i\mid\theta)\) gives the posterior kernel by Bayes’ rule.
For an observed event, the event-time density contribution is \(h_i(T_i\mid\theta,b_i)\exp[-H_i(T_i\mid\theta,b_i)]\). For right censoring, it is \(\exp[-H_i(T_i\mid\theta,b_i)]\). The indicator form in the definition combines these cases. The shared random effect appears in both outcome models, so each subject’s measurements and event history can both inform \(b_i\).
Worked Example: One Subject’s Posterior Kernel
Consider a hypothetical subject with one measurement \(Y=1\), observed event time \(T=3\), and \(\delta=1\). At fixed parameter values, suppose \(Y\mid b\sim N(b,1)\), \(b\sim N(0,1)\), and the hazard is constant over time at \(h(b)=0.2\exp(0.5b)\). Evaluate the unnormalized posterior kernel for this subject at \(b=0.2\). The normal distribution’s second argument here is its variance.
The longitudinal density is $$ f_Y(1\mid b=0.2) =\frac{1}{\sqrt{2\pi}}\exp\left[-\frac{(1-0.2)^2}{2}\right] \approx 0.289692. $$
The hazard and cumulative hazard at time 3 are \(h(0.2)=0.2\exp(0.1)\approx0.221034\) and \(H(3\mid b=0.2)=3h(0.2)\approx0.663103\). Since an event was observed, its contribution is $$ h(0.2)\exp[-H(3\mid b=0.2)] =0.221034\exp(-0.663103) \approx 0.1139. $$
The random-effects density is $$ p(b=0.2)=\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{0.2^2}{2}\right) \approx 0.391043. $$
Ignoring the parameter prior, which is constant with respect to \(b\) in this evaluation, the subject-level kernel is therefore $$ 0.289692\times 0.113888\times 0.391043 \approx 0.01290. $$ This is an unnormalized density value at \(b=0.2\), not a posterior probability. To obtain a posterior density for \(b\), the kernel would have to be normalized over the possible values of \(b\), with the other quantities treated as specified.
Conditional Independence Is Not Marginal Independence
The factorization is conditional on the shared random effects. If those effects are integrated out, the resulting joint density is generally not the product of a longitudinal marginal density and a survival marginal density. Both data sources depend on \(b_i\), and integrating over a common latent variable can induce dependence between them.
For a single subject, the marginal likelihood contribution has the form $$ \int p(Y_i\mid\theta,b_i)\, p(T_i,\delta_i\mid\theta,b_i)\, p(b_i\mid\theta)\,db_i. $$ This is generally different from $$ \left\{\int p(Y_i\mid\theta,b_i)p(b_i\mid\theta)\,db_i\right\} \left\{\int p(T_i,\delta_i\mid\theta,b_i)p(b_i\mid\theta)\,db_i\right\}, $$ because the latter uses two separate integrations and does not preserve the shared dependence induced by the same \(b_i\). The distinction is central: the joint model links the outcome processes through shared latent effects, even when they are conditionally independent given those effects.
Worked Example: Comparing Two Random-Effects Values
Use the hypothetical model \(Y\mid b\sim N(b,1)\), \(b\sim N(0,1)\), and \(h(b)=0.2\exp(b)\). Suppose the subject has \(Y=1\), an event at \(T=2\), and \(\delta=1\). Compare the posterior kernel, omitting the common parameter prior, at \(b=0\) and \(b=\log 2\).
At \(b=0\), the longitudinal density is \(\phi(1;0,1)\approx0.241971\). The hazard is \(0.2\), so the event contribution is \(0.2\exp(-2(0.2))=0.2\exp(-0.4)\approx0.134064\). The random-effects density is \(\phi(0;0,1)\approx0.398942\). Therefore, $$ 0.241971\times0.134064\times0.398942\approx0.01294. $$
At \(b=\log 2\approx0.693147\), the longitudinal density is $$ \phi(1;\log 2,1) =\frac{1}{\sqrt{2\pi}}\exp\left[-\frac{(1-\log 2)^2}{2}\right] \approx0.380596. $$ The hazard is \(0.2\exp(\log 2)=0.4\), giving event contribution \(0.4\exp(-2(0.4))\approx0.179732\). The random-effects density is \(\phi(\log 2;0,1)\approx0.313748\). Thus, $$ 0.380596\times0.179732\times0.313748\approx0.02146. $$
The ratio of these kernels is approximately \(0.02146/0.01294\approx1.66\). At these fixed model parameters, the unnormalized kernel at \(b=\log 2\) is about 1.66 times the kernel at \(b=0\). This comparison alone does not give the posterior probability of either value or show that one value is more probable in an interval; those require considering and normalizing the kernel over the full parameter space.
Subject-Level and Whole-Sample Products
The subject-level likelihood contribution is \(L_i(\theta,b_i)\). The subject-level posterior-kernel contribution also includes the random-effects density \(p(b_i\mid\theta)\). The whole-sample posterior kernel multiplies those contributions across subjects and includes \(p(\theta)\) once. Keeping these objects distinct helps prevent double-counting a prior or omitting a random-effects density.
Worked Example: Multiplying Contributions Across Subjects
Consider two hypothetical subjects under the model \(Y_i\mid b_i\sim N(b_i,1)\), \(b_i\sim N(0,1)\), and \(h_i(t\mid b_i)=0.2\exp(b_i)\). Subject 1 has \(Y_1=0\), an event at \(T_1=1\), and \(b_1=0\). Subject 2 has \(Y_2=1\), an event at \(T_2=2\), and \(b_2=\log 2\). Evaluate the joint kernel at these random-effects values, omitting the common parameter prior.
For subject 1, the longitudinal density is \(\phi(0;0,1)\approx0.398942\); the event contribution is \(0.2\exp(-0.2)\approx0.163746\); and the random-effects density is \(\phi(0;0,1)\approx0.398942\). The contribution is $$ 0.398942\times0.163746\times0.398942\approx0.02606. $$
For subject 2, the corresponding factors are \(0.380596\), \(0.179732\), and \(0.313748\), as calculated in the preceding example. Their product is approximately \(0.02146\). Conditional independence across subjects gives the whole-sample kernel $$ 0.02606\times0.02146\approx0.000559. $$
This product is the kernel at the specified pair \((b_1,b_2)\), not the marginal likelihood. To obtain a likelihood for the shared parameters alone, the product of subject contributions would be integrated over both random effects.
Assumptions, Checks, and Alternatives
A useful audit begins by checking that every observed measurement appears once in the longitudinal product, that each subject has the correct event indicator and time contribution, and that the random-effects density is included once for each subject. Check also that the same \(b_i\) enters both outcome models as intended, and that the prior \(p(\theta)\) is included once for the whole parameter vector. For a time-varying hazard, confirm that the cumulative hazard is integrated over the subject’s observed follow-up interval.
A factorization can be algebraically correct but inappropriate for the data-generating or observation process. Warning signs include dependence between outcomes that remains after conditioning on the modeled random effects, unmodeled dependence across subjects, informative censoring not represented in the likelihood, or a measurement schedule whose mechanism depends on unmodeled outcome information. These issues call for revising the model or adding an appropriate component; rearranging the same factors does not resolve them.
One alternative is to fit the longitudinal and survival models separately. That may be simpler, but it does not generally account for their shared latent effects and may not represent their joint uncertainty. A likelihood-based joint analysis instead integrates the random effects out of the likelihood; a Bayesian analysis retains them in the joint posterior and includes priors. These approaches differ in inferential framework and computation, but both must respect the specified dependence structure. The posterior factorization itself is not a computational algorithm and does not guarantee that the posterior is easy to explore or that its parameters are well identified.
The factorization’s practical value is clarity: it shows exactly how measurements, event history, latent effects, and priors contribute to the posterior. It also makes clear where the model’s assumptions enter. It does not by itself validate the model, select priors, or determine how posterior computation should be carried out.
Check Your Understanding
Answer each question by identifying the relevant factor or assumption.
- For a right-censored subject with \(\delta_i=0\), which part of the survival contribution remains?
- Why can the longitudinal and survival outcomes be conditionally independent but marginally dependent?
- Where does the random-effects density appear in the joint posterior kernel?
- In a two-subject model, how many times does the parameter prior \(p(\theta)\) appear in the whole-sample kernel?
- What additional operation is needed to obtain a marginal likelihood for \(\theta\) from the joint likelihood that includes \(b_1,\ldots,b_n\)?
Solutions. (1) With \(\delta_i=0\), the hazard term is \(h_i(T_i\mid\theta,b_i)^0=1\), leaving \(\exp[-H_i(T_i\mid\theta,b_i)]\). (2) Both outcomes depend on the same latent \(b_i\); integrating over that shared effect can induce dependence. (3) It appears once per subject as \(p(b_i\mid\theta)\), alongside that subject’s longitudinal and survival likelihood factors. (4) It appears once for the whole parameter vector, outside the product over subjects. (5) Integrate the joint likelihood over all random effects, using their joint density as part of the integrand.