Why the Posterior Has Both Subject Effects and Model Parameters
A joint model uses repeated measurements and event-time information together. The longitudinal measurements help describe each subject’s underlying trajectory; the event process can depend on that same trajectory or on the random effects that generate it. In a Bayesian analysis, those subject-specific effects are not simply fixed estimates inserted into a survival model. They are latent quantities whose uncertainty is represented in the posterior along with uncertainty in the model parameters.
The construction begins by separating three things: what was observed, what is unobserved but modeled, and what parameters govern the model. This separation also makes it easier to see where censoring enters and which assumptions are needed for the resulting posterior to represent the intended analysis.
The observed times and event indicators are data; the unobserved event times for censored subjects are not observed data. A censored subject contributes information that the event time exceeds \(T_i\), not that an event occurred at \(T_i\). The random effects \(b_i\), in contrast, are latent variables introduced to describe subject-level heterogeneity. They are not additional observed measurements.
A Shared-Random-Effects Model
A common specification uses a Gaussian mixed model for the longitudinal response. Write its conditional mean as \(m_i(t;b_i)=x_i(t)^\mathsf{T}\beta+z_i(t)^\mathsf{T}b_i\), where \(x_i(t)\) and \(z_i(t)\) are known design vectors, \(\beta\) is a vector of fixed effects, and \(b_i\) is a subject-specific random-effects vector. For clarity, suppose \(y_{ij}\mid b_i,\theta\sim N(m_i(t_{ij};b_i),\sigma^2)\). The usual conditional independence assumption is that the repeated responses are independent given the random effects and model parameters.
One way to share the random effects with the event process is a current-value association model: \(h_i(t\mid b_i,\theta)=h_0(t;\gamma)\exp\{\alpha m_i(t;b_i)\}\). Here \(h_0(t;\gamma)\) is a baseline hazard, \(\gamma\) denotes its parameters, and \(\alpha\) controls how the current longitudinal mean is associated with the hazard. A positive \(\alpha\) means that larger current mean values correspond to a larger conditional hazard, holding the other model quantities fixed. This is a model-based association, not by itself a causal effect.
The same \(b_i\) appears in both the longitudinal mean and the hazard. Conditional on \(b_i\) and \(\theta\), the longitudinal and event observations are taken to be independent in this specification. Their dependence marginally arises because both are linked through the shared latent effects. Let the random effects have distribution \(b_i\sim N_q(0,D)\), independently across subjects conditional on the covariance matrix \(D\). The parameter collection \(\theta\) includes \(\beta,\sigma^2,D,\gamma,\alpha\).
From Conditional Models to the Posterior
For a given subject, the event-time likelihood follows from the hazard and its cumulative hazard. Define \(H_i(T_i\mid b_i,\theta)=\int_0^{T_i}h_i(s\mid b_i,\theta)\,ds\). The conditional survival probability through time \(T_i\) is \(\exp\{-H_i(T_i\mid b_i,\theta)\}\). If \(\delta_i=1\), the event-time density is the hazard at the observed event time multiplied by the probability of surviving up to that time. If \(\delta_i=0\), the contribution is the probability of surviving through the censoring time. These cases combine as
This expression assumes right censoring that is noninformative conditional on the modeled information: the censoring mechanism does not add an unmodeled dependence on the event process or latent effects. It also assumes the event-time model is correctly specified over the interval from time zero to \(T_i\). If entry occurs after time zero, delayed entry must be represented in the likelihood rather than silently using this form.
Suppose, in addition, that the longitudinal observation process is conditionally independent of the event process given \(b_i\) and \(\theta\), and that measurement times are fixed by design or ignorable for the analysis. The conditional longitudinal likelihood is then the product of normal densities. With a prior density \(p(\theta)\) and the stated random-effects distribution, the joint posterior density is proportional to
Here \(\phi_q(b_i;0,D)\) is the \(q\)-variate normal density with mean zero and covariance \(D\). This is a density over both the parameters and the latent random effects. It is not normalized by the proportionality statement; the normalizing constant is the marginal probability density of the observed data under the model and prior.
The assumptions behind this construction are substantive. The Gaussian mixed-model distribution must be appropriate for the responses, the event hazard must be meaningful and nonnegative, and the random-effects distribution must represent the intended subject heterogeneity. Conditional independence must be credible after conditioning on the shared effects. The prior must be specified on the parameter space, with support restricted to valid values such as \(\sigma^2>0\) and positive-definite \(D\). A proper prior is a straightforward way to ensure a well-defined posterior, although an improper prior can sometimes yield a proper posterior; that propriety must be established, not presumed.
Worked Example: Separating Data, Latent Effects, and Parameters
Suppose a hypothetical subject has measurements \(y_{i1}=1.2\) at \(t_{i1}=0\) and \(y_{i2}=1.5\) at \(t_{i2}=1\). The observed event record is \(T_i=2\), \(\delta_i=0\): the subject is right-censored at time 2.
The observed data for this subject are the two response-time pairs and the censoring record \((T_i,\delta_i)=(2,0)\). The latent quantity is \(b_i\), for example a random intercept and slope. It is not known merely because the two responses have been recorded.
The parameters include the fixed effects \(\beta\), residual variance \(\sigma^2\), random-effects covariance \(D\), baseline-hazard parameters \(\gamma\), and association parameter \(\alpha\). The data values \(1.2\), \(1.5\), \(0\), \(1\), and \(2\) are not parameters. This classification determines the posterior’s structure: the data enter through likelihood terms, while \(b_i\) is inferred jointly with \(\theta\).
A Time-Varying Hazard Must Be Integrated
A frequent source of error is treating the hazard at the observed event time as if it had been constant throughout follow-up. The hazard determines the instantaneous event rate; the cumulative hazard accounts for risk over the entire interval. In a current-value model, the mean trajectory may change with time, so the hazard can change too.
Worked Example: Event Contribution Under a Changing Mean
Consider a hypothetical subject with current longitudinal mean \(m_i(t;b_i)=0.7+0.1t\), baseline hazard \(h_0(t)=0.1\) per year, association parameter \(\alpha=0.5\), and observed event at \(T_i=2\) years (\(\delta_i=1\)). The conditional hazard is \(h_i(t)=0.1\exp\{0.5(0.7+0.1t)\}=0.1e^{0.35+0.05t}\) per year.
The cumulative hazard is not \(2h_i(2)\). It is the integral over follow-up:
At the event time, \(h_i(2)=0.1e^{0.45}\approx0.1568\) per year. Therefore the event contribution is
The hazard is evaluated at the event time for the density factor, but the survival factor uses the integrated hazard from 0 to 2 years. Replacing the integral by \(2h_i(2)\) would incorrectly assume a constant hazard equal to its endpoint value.
Putting the Terms Together at a Parameter Value
The joint posterior is a function of the unknown parameters and latent effects. A numerical evaluation of its unnormalized density at one proposed value can check whether the pieces have been assembled consistently. Such a value is a density, not a posterior probability at that exact point.
Worked Example: Evaluating a Joint Kernel
Continue with a hypothetical one-subject model. Let \(m_i(t;b_i)=0.5+0.1t+b_i\), \(b_i\sim N(0,1)\), and \(y_{i1}\mid b_i\sim N(m_i(1;b_i),1)\). Suppose \(y_{i1}=0.8\), an event occurs at \(T_i=2\), \(h_0(t)=0.1\) per year, and \(\alpha=0.5\). Evaluate the likelihood times the random-effects density at \(b_i=0.2\), holding the global parameters fixed. For this value, \(m_i(t;b_i)=0.7+0.1t\), so the event calculation above applies.
At measurement time 1, the fitted mean is \(0.5+0.1(1)+0.2=0.8\). Thus the longitudinal density is
The event contribution is approximately \(0.1164\) per year, and the random-effects density is
Multiplying these three terms gives the subject-level kernel at the specified values: \(0.3989\times0.1164\times0.3910\approx0.01815\), with units given by the product of the longitudinal, event-time, and random-effects densities. This is not a normalized posterior probability and does not yet include the prior density for the global parameters. In a full posterior calculation, that prior and the corresponding terms for all subjects must also be included.
Joint and Marginal Posterior Targets
The displayed posterior retains \(b_1,\ldots,b_N\) as latent variables. One can instead describe uncertainty about \(\theta\) alone by integrating them out:
This integral is the Bayesian counterpart of accounting for random-effects uncertainty rather than substituting a single estimated value. The joint and marginal forms describe related targets, but they are not interchangeable numerical expressions: the joint density is evaluated at particular latent effects, whereas the marginal density averages over their possible values under the model. In practice, the integral may be difficult, which is one reason computational methods are needed. The posterior construction itself does not prescribe a particular sampling algorithm.
The prior matters because the posterior combines prior information with the likelihood. For a continuous parameter, the posterior probability of any single exact value is zero. Statements of posterior probability should refer to a region or event, such as \(P(\alpha>0\mid\mathcal{O})\), not to the probability of \(\alpha\) being exactly a specified number. Nor does a posterior probability of a region represent the probability that the model as a whole is correct.
Diagnostics, Alternatives, and Limitations
Before computation, check that the posterior expression matches the data-generating setup. Verify that each observed response contributes once, that each subject has one event-time contribution, and that every random effect has its distributional density. For a censored subject, \(\delta_i=0\) removes the event-time hazard factor but leaves the survival term. Check the dimensions of \(b_i\) and \(D\), the units of the hazard, and whether the cumulative hazard is integrated over the correct time interval.
A useful alternative is to write the conditional likelihood and then multiply by the random-effects density and parameter prior, as done above. This makes the latent variables explicit. Integrating the random effects first gives a marginal likelihood for \(\theta\), but can obscure the subject-level structure and may be computationally demanding. Plugging in fitted random effects is not equivalent to either approach: it ignores uncertainty in those effects and generally does not produce the same posterior.
Posterior calculations can also be misleading when the model assumptions are poor. A misspecified longitudinal distribution, an inadequate baseline hazard, informative censoring not represented in the model, or an incorrect dependence structure can distort inference. The shared-effects construction captures dependence only through the specified latent effects and hazard link; it cannot automatically represent every source of association between measurements and event times. Diagnostics should therefore examine both the longitudinal and event components, as well as the plausibility of the shared-effects assumptions.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions.
- For a subject with \(\delta_i=0\), which part of the event-time likelihood remains?
- Why is \(b_i\) classified as latent rather than observed in the shared-random-effects model?
- If the current-value hazard changes over follow-up, what quantity must be integrated to obtain the survival factor through time \(T_i\)?
- What does \(P(\alpha>0\mid\mathcal{O})=0.8\) mean, and what does it not mean?
- Why is substituting a single estimated random effect not generally equivalent to integrating it out?
Solutions. (1) The survival term \(\exp\{-H_i(T_i\mid b_i,\theta)\}\) remains; the hazard factor is raised to \(\delta_i=0\), so it equals 1. (2) It is an unobserved subject-specific quantity introduced by the model and inferred from the observed data. (3) Integrate the conditional hazard, \(H_i(T_i)=\int_0^{T_i}h_i(s)\,ds\). (4) It is an 80% posterior probability for the region \(\alpha>0\), conditional on the observed data, model, and prior; it is not the probability that the model is correct. (5) Integration averages over uncertainty in the random effect, while substitution conditions on one value and discards that uncertainty.