Why Audit the Likelihood?
A written joint-model likelihood can look plausible while encoding the wrong data. One event indicator applied to the wrong follow-up limit, one omitted marker measurement, or one random effect substituted for an integration can change what the likelihood represents. An audit is therefore not just a check of algebra: it verifies that every observed quantity enters in the right place and that unobserved quantities are treated according to the model.
The earlier material on assembling a joint likelihood from a study dataset provides the broad construction. Here the task is narrower and practical: inspect each factor in a basic likelihood and ask what data and assumptions justify it. The calculations below use a deliberately small hypothetical dataset so that the conditional contributions and the final integration can both be checked numerically.
The Likelihood Pieces and Their Assumptions
Suppose the marker measurements are conditionally independent given \(b_i\), with density \(f_Y(Y_{ij}\mid b_i)\). Suppose also that, conditional on \(b_i\), the marker data and event process have the factorization specified by the model. Write the conditional hazard as \(\lambda_i(t\mid b_i)\), and define its cumulative hazard through time \(u\) by
The conditional survival probability through \(u\) is \(S_i(u\mid b_i)=\exp\{-\Lambda_i(u\mid b_i)\}\). If an event is observed at \(T_i\), its event-time contribution is the density \(\lambda_i(T_i\mid b_i)S_i(T_i\mid b_i)\). If follow-up ends at \(T_i\) without an observed event, the contribution is \(S_i(T_i\mid b_i)\). These can be written together as
This expression assumes the recorded event indicator and follow-up time are correctly defined, and that censoring is noninformative under the model: conditional on modeled information, the censoring process does not add an unmodeled factor to the event-time likelihood. It also assumes that the stated hazard is the hazard for the event being analyzed. An observed event contributes a density, not the probability of an event at one exact time; a censored observation contributes survival through its censoring time.
Let \(f_b(b_i)\) denote the random-effects density. Under the stated conditional factorization, the subject likelihood is
where \(\mathcal O_i\) indexes the marker measurements actually observed for subject \(i\). The product includes each observed measurement once; a missing measurement contributes no observed-data density factor in this expression. The integral averages the entire conditional likelihood over possible random effects. It does not evaluate that likelihood only at a single estimated random effect.
A Step-by-Step Audit
Check that \(\delta_i=1\) only when an event is recorded, and \(\delta_i=0\) for right-censoring. Confirm that \(T_i\) is the event time or censoring time actually observed.
List the observed marker times and values. Each observed value should appear once with its model-based density; missing values should not be silently treated as observed.
For an event, verify both the hazard at \(T_i\) and cumulative hazard through \(T_i\). For censoring, verify survival through the censoring time and no event-hazard multiplier.
Multiply the marker and event contributions conditional on the same \(b_i\), multiply by its distribution, and then integrate or sum over \(b_i\).
Marker densities carry inverse marker units per measurement, and an event-time density carries inverse time units. The integrated contribution retains the corresponding joint-density units.
Worked Audit With a Hypothetical Dataset
Consider one hypothetical subject with three observed marker values \(Y_{ij}=(1.1,1.4,1.8)\), measured at \(t_{ij}=(0,1,2)\) years. The marker model is normal with mean \(m(t;b)=1+0.2t+b\) and residual standard deviation \(0.5\). For this arithmetic illustration, the random effect has a two-point distribution: \(P(b=0.5)=P(b=-0.5)=0.5\). The subject experiences the event at \(T=2.5\) years, so \(\delta=1\). Conditional on \(b\), the hazard is constant over time at \(\lambda(t\mid b)=0.2e^b\) events per year. Assume the marker errors are independent conditional on \(b\), the event contribution has the stated conditional hazard, and the random-effect probabilities are correctly specified.
Worked Example: Audit the Event-Time Factor
Because \(\delta=1\), the subject has an observed event, not a censoring time. With a constant hazard \(\lambda(b)=0.2e^b\), the cumulative hazard through 2.5 years is \(2.5\lambda(b)\). Thus the correct conditional event-time contribution is \(\lambda(b)\exp\{-2.5\lambda(b)\}\).
At \(b=0.5\), \(\lambda(0.5)=0.2e^{0.5}=0.3297\) per year, so
At \(b=-0.5\), \(\lambda(-0.5)=0.2e^{-0.5}=0.1213\) per year, giving
Both calculations use the observed follow-up limit of 2.5 years. Replacing it with the last marker time, 2 years, would be an error: the event process is followed until the event time. If the same record instead had \(\delta=0\), the contribution would be survival alone, \(\exp\{-2.5\lambda(b)\}\), without the hazard multiplier.
Worked Example: Audit the Marker-Density Product
For a normal measurement with standard deviation \(0.5\), the density at residual \(r\) is \((\sqrt{2\pi}\,0.5)^{-1}\exp(-2r^2)\). The marker contribution is the product of three such densities, one for each observed value.
At \(b=0.5\), the model means at years 0, 1, and 2 are \(1.5,1.7,1.9\). The residuals (observed minus modeled) are \(-0.4,-0.3,-0.1\), and the sum of their squares is \(0.16+0.09+0.01=0.26\). Therefore,
At \(b=-0.5\), the means are \(0.5,0.7,0.9\); the residuals are \(0.6,0.7,0.9\), with squared sum \(0.36+0.49+0.81=1.66\). Thus
The marker-density product has units of inverse marker-units cubed, because it is a joint density for three measurements. It is not a probability that all three observations equal exactly these values.
Worked Example: Integrate the Conditional Contributions
Conditional independence in the specified model makes the conditional joint contribution the marker product times the event-time contribution. At \(b=0.5\), the calculation is
At \(b=-0.5\), it is
The random effect is not observed, so weight each conditional contribution by its probability and sum. For this two-point distribution, integration is exactly a weighted sum:
The marginal joint density contribution is approximately \(0.02266\) per year per marker-unit cubed. It is a likelihood contribution for this hypothetical record, not a probability assigned to the record.
Why the Integration Comes Last
The position of the integral follows directly from the model's conditional data generation. Given a particular \(b_i\), the marker observations and event time jointly contribute the product of their conditional factors. Since \(b_i\) is unobserved, the observed-data likelihood averages this product over the possible values of \(b_i\). For a discrete random effect \(b\) with possible values \(b_k\) and probabilities \(w_k\), this is
This identity is the finite-support version of the integral in the general likelihood. It shows why separately averaging the marker and event factors and then multiplying is generally wrong: in general, the average of a product is not the product of the averages. Likewise, evaluating both factors at an estimated random effect gives a conditional plug-in contribution, not the integrated observed-data likelihood.
Common Errors, Diagnostics, and Alternatives
- Wrong event indicator. A censored subject should not receive a hazard-at-\(T_i\) multiplier. An event subject should receive both that multiplier and survival through the event time.
- Wrong follow-up limit. The cumulative hazard ends at the recorded event or censoring time, not automatically at the final marker measurement.
- Missing or duplicated marker factors. Reconcile the measurement product against a list of observed values and times. The count of density terms should equal the count of observed measurements.
- Integrating factors separately. Unless special conditions make the factors independent over the random-effect distribution, average their conditional product, not each factor separately.
- Plugging in an estimated random effect. This replaces averaging over its distribution with evaluation at one value. It is not the marginal likelihood.
Useful numerical checks include evaluating each factor separately, checking that the cumulative hazard is nonnegative and increases with follow-up, and comparing a hand calculation with a direct numerical integral or weighted sum. For continuous random effects, computations are often performed on the log scale to reduce underflow; numerical integration or quadrature approximates the integral, and its accuracy should be checked by refining the calculation.
A model that ignores the shared random effect or treats it as known may be simpler, but it answers a different likelihood question. A correctly specified marginal likelihood integrates the latent effect; an alternative likelihood is appropriate only if its assumptions and target model are appropriate for the scientific analysis. This audit does not establish that the model itself is scientifically adequate: it checks that the written likelihood matches the stated model and observed record. Misspecified marker distributions, an incorrect hazard, or informative censoring require modeling changes, not merely arithmetic correction.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- A subject is right-censored at 3 years. What event-time contribution applies under conditional hazard \(\lambda(t\mid b)\)?
Solution: Survival through censoring: \(\exp\{-\int_0^3\lambda(s\mid b)\,ds\}\). There is no hazard multiplier because no event was observed. - A subject has an event at 4 years but the last marker was measured at 3 years. At what time does the cumulative hazard stop?
Solution: At 4 years, the observed event time. Marker measurement times do not determine the end of event follow-up. - If \(b\) takes values \(b_1,b_2\) with probabilities \(0.3,0.7\), write the marginal likelihood using conditional joint contributions \(Q(b_1)\) and \(Q(b_2)\).
Solution: \(L=0.3Q(b_1)+0.7Q(b_2)\). The conditional marker and event factors are multiplied within each \(Q\) before weighting and summing. - Why is \(Q(\hat b)\) generally not the marginal likelihood contribution?
Solution: It evaluates the conditional contribution at one estimated random effect. The marginal likelihood averages the conditional contribution over the random-effect distribution.