Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Piecewise Survival Likelihoods for INLA

Bayesian Joint Models · Tutorial 333 of 697

Piecewise Survival Likelihoods for INLA

You will construct the person-interval data and Poisson offsets that reproduce a piecewise exponential survival likelihood for INLA.

Advanced 12 min read

What You'll Learn

  • Define interval-specific event counts and time-at-risk exposures from right-censored follow-up.
  • Derive the equivalence between the piecewise exponential likelihood and Poisson likelihood contributions.
  • Use log exposure as an offset and distinguish it from the interval-specific log hazard.
  • Assign events at cutpoints consistently and handle the first cutpoint without omitting events.
  • Check the assumptions and recognize when the Poisson representation is only an approximation.

From Event Histories to Interval Contributions

INLA works with likelihood contributions attached to observations, so a survival history must be represented in a form compatible with its likelihood framework. For a piecewise exponential model, each person’s follow-up is split across time intervals. Each interval contributes an event count and the amount of time that person was at risk there. The resulting Poisson likelihood has a log exposure offset and an interval-specific log hazard.

This representation is useful because it expresses a survival likelihood through a familiar Poisson likelihood while retaining the event-time and censoring information. The equivalence is a statement about likelihoods conditional on the model parameters and observed risk times; it does not mean that one person can experience a new independent terminal event in every interval.

Definition: Let \(T_i\) be the event time for person \(i\), \(C_i\) the censoring time, \(Y_i=\min(T_i,C_i)\) the observed follow-up time, and \(\delta_i=1\) if the event is observed and \(0\) if follow-up is censored. Choose cutpoints \(a_0<a_1<\cdots<a_K\) covering the observed follow-up. Assume each included person is observed after \(a_0\), so \(Y_i>a_0\), and every observed event time is strictly greater than \(a_0\). Interval \(k\) is \((a_{k-1},a_k]\). The interval event count is \(d_{ik}=1\) if \(\delta_i=1\) and \(a_{k-1}<Y_i\leq a_k\), and \(0\) otherwise. The exposure \(E_{ik}\) is the time person \(i\) is at risk in that interval: \(E_{ik}=\max\{0,\min(Y_i,a_k)-a_{k-1}\}\).

The cutpoints must cover every observed event and censoring time. A row is retained only if \(E_{ik}>0\); rows with zero exposure carry no likelihood information and cannot have a finite log-offset. With the interval convention above, an event exactly at an internal cutpoint \(a_k\) belongs to interval \(k\), not interval \(k+1\). The strict condition \(Y_i>a_0\) for events ensures that each event is assigned to exactly one interval. If an event occurs at a proposed \(a_0\), choose a lower starting cutpoint so that the event time is inside the modeled follow-up, or address the entry-time event with an appropriate model rather than silently dropping it.

The Piecewise Exponential Model

Within interval \(k\), suppose person \(i\) has a constant hazard conditional on covariates and latent effects. Write this hazard as \(\lambda_{ik}=\exp(\eta_{ik})\), where \(\eta_{ik}\) is the interval-specific log hazard. For example, it may contain a baseline term \(\alpha_k\), measured covariates, and shared latent effects from a joint model. The relevant requirement for the exact piecewise exponential likelihood is that the hazard be constant over each person-interval exposure, conditional on those quantities.

$$ \lambda_i(t)=\exp(\eta_{ik}),\qquad a_{k-1}<t\leq a_k. $$

Conditional on the model quantities, the contribution of person \(i\) to the survival likelihood is the hazard at the observed event time, if an event is observed, multiplied by the probability of surviving through the observed follow-up. Under a piecewise constant hazard, the cumulative hazard through \(Y_i\) is \(\sum_k E_{ik}\lambda_{ik}\). Thus, apart from factors not involving the model parameters, the contribution is \(\prod_k \lambda_{ik}^{d_{ik}}\exp(-E_{ik}\lambda_{ik})\).

$$ L_i = \prod_{k:E_{ik}>0} \lambda_{ik}^{d_{ik}}\exp(-E_{ik}\lambda_{ik}) = \prod_{k:E_{ik}>0} \exp\{d_{ik}\eta_{ik}-E_{ik}\exp(\eta_{ik})\}. $$

The same parameter-dependent expression arises from Poisson observations \(d_{ik}\sim\operatorname{Poisson}(\mu_{ik})\), with \(\mu_{ik}=E_{ik}\exp(\eta_{ik})\). A Poisson log-link model therefore uses \(\log(E_{ik})\) as an offset and \(\eta_{ik}\) as the modeled log rate. For an event row, the Poisson probability also contains the factor \(E_{ik}\); since the observed exposure is fixed, that factor does not depend on the parameters and does not change the likelihood for estimation or posterior inference.

$$ \log(\mu_{ik})=\log(E_{ik})+\eta_{ik}, \qquad P(d_{ik}\mid \mu_{ik}) = \frac{\exp(-\mu_{ik})\mu_{ik}^{d_{ik}}}{d_{ik}!}. $$

Why the Poisson Likelihood Matches

The equivalence follows directly by substituting the Poisson mean. For one interval, its likelihood factor is \(\exp\{-E_{ik}\exp(\eta_{ik})\}\{E_{ik}\exp(\eta_{ik})\}^{d_{ik}}/d_{ik}!\). Separating the terms that depend on the model parameters gives \(\exp\{-E_{ik}\exp(\eta_{ik})\}\exp(d_{ik}\eta_{ik})\), which is the interval factor in the survival likelihood. The remaining factor \(E_{ik}^{d_{ik}}/d_{ik}!\) is fixed by the observed data.

$$ \frac{\exp\{-E_{ik}\exp(\eta_{ik})\} \{E_{ik}\exp(\eta_{ik})\}^{d_{ik}}}{d_{ik}!} = \underbrace{\frac{E_{ik}^{d_{ik}}}{d_{ik}!}}_{\text{does not depend on model parameters}} \exp\{d_{ik}\eta_{ik}-E_{ik}\exp(\eta_{ik})\}. $$

Multiplying across the intervals gives the stated likelihood equivalence. A single terminal event generates at most one event count equal to 1 for a person; the other retained interval counts are zero. The rows after an observed event are not included because that person is no longer at risk. The Poisson formulation is therefore a likelihood construction for the observed person-time, not a claim that terminal events recur independently for the same person.

Worked Example: One Event Across Three Intervals

Suppose a hypothetical person has an observed event at \(Y_i=2.4\) time units, with cuts \(0,1,2,3\). The event time is strictly greater than the starting cutpoint and lies in the third interval, \((2,3]\). Suppose the interval hazards are \(0.10\), \(0.20\), and \(0.40\) per time unit.

The exposures are \(E_{i1}=1\), \(E_{i2}=1\), and \(E_{i3}=2.4-2=0.4\). The counts are \(d_{i1}=0\), \(d_{i2}=0\), and \(d_{i3}=1\). The survival likelihood contribution is \(1\cdot\exp(-0.10)\times1\cdot\exp(-0.20)\times0.40\exp\{-0.4(0.40)\}\).

$$ L_i=0.40\exp\{-(0.10+0.20+0.16)\} =0.40\exp(-0.46)\approx 0.2525. $$

The Poisson means are \(0.10\), \(0.20\), and \(0.16\), because each is exposure multiplied by its hazard. The product of the Poisson probabilities is \(\exp(-0.10)\times\exp(-0.20)\times\{0.16\exp(-0.16)\}\), which is approximately \(0.1010\). This is \(0.4\) times the survival likelihood contribution: the ratio is the observed event-interval exposure, a data-only factor. Both likelihoods therefore give the same inference about the hazards.

Building the Person-Interval Data

For each person, create one row per interval with positive exposure. The response is \(d_{ik}\), the offset is \(\log(E_{ik})\), and the linear predictor contains the interval-specific log hazard. In practice, an interval baseline can be represented by interval indicators or another suitable structured effect. In a joint model, the shared latent effects enter the event predictor according to the specified association structure; this tutorial concerns the survival likelihood representation, not the full joint-model encoding.

Person and intervalExposureEvent countPoisson offset
Person i, interval k\(E_{ik}>0\), time units\(d_{ik}=0\) or \(1\)\(\log(E_{ik})\)

Worked Example: A Censored Follow-Up and Its Offsets

A hypothetical person is censored at \(Y_i=1.6\) time units. The cutpoints are \(0,1,2\), and the hazards are \(0.05\) and \(0.10\) per time unit in the two intervals. Since no event is observed, both interval counts are zero.

The first interval exposure is \(1-0=1\), and the second is \(1.6-1=0.6\). The corresponding offsets are \(\log(1)=0\) and \(\log(0.6)\approx-0.5108\). The means are \(1(0.05)=0.05\) and \(0.6(0.10)=0.06\). The product of the two zero-count Poisson probabilities is

$$ \exp(-0.05)\exp(-0.06) =\exp(-0.11)\approx0.8958. $$

This equals the probability of surviving to the censoring time under the specified hazards. Using the full length of the second interval, \(1\), would incorrectly count \(0.4\) time units after censoring and would produce the wrong survival contribution.

Cutpoints, Conditions, and Diagnostics

The representation depends on correct risk-time construction and on the event process assumptions. Conditional on covariates and latent effects, the event hazard must be piecewise constant for the exact likelihood shown above. Censoring is assumed non-informative conditional on the modeled information: censoring must not carry additional information about the event time after conditioning on that information. Each person’s event and censoring status must be correctly recorded, and follow-up must stop at the observed event or censoring time. A competing event requires a competing-risks formulation rather than treating it automatically as ordinary independent censoring.

When an event occurs exactly at an internal cutpoint \(a_k\), the adopted convention assigns it to interval \(k\), with exposure through \(a_k\). An event at the first cutpoint \(a_0\) is different: it is not in any interval \((a_{k-1},a_k]\). The data setup must therefore require event times to be strictly greater than \(a_0\), as above, or place \(a_0\) earlier than every event time. This explicit condition prevents an observed event from receiving zero event counts across all intervals.

Worked Example: An Event at an Internal Cutpoint

Suppose a hypothetical event is observed at time \(Y_i=2\), and the cuts are \(0,1,2,3\). Under the stated interval convention, \(2\in(1,2]\), so the event belongs to interval 2. The exposures are \(1,1,0\); the first two intervals are retained, while the zero-exposure third interval is omitted. The event counts are \(0,1\) on the retained rows. If the hazards are \(0.10\) and \(0.20\), the event likelihood is

$$ \exp(-0.10)\times \{0.20\exp(-0.20)\} =0.20\exp(-0.30)\approx0.1482. $$

The event is counted once, in the interval ending at time 2. Assigning it instead to interval 3 would give that interval zero exposure and would fail to represent the observed event in the likelihood.

Useful checks include verifying that each observed event has exactly one interval with \(d_{ik}=1\), that no censored person has a positive event count, and that each person’s exposures sum to \(Y_i-a_0\) when everyone enters at \(a_0\) and follow-up begins after it. Also confirm \(E_{ik}>0\) for every retained row and that the offset is the logarithm of that row’s actual exposure, not the log of the full interval width by default. If computed exposures do not sum to observed follow-up, inspect cutpoint coverage, event assignment, and the handling of censoring times at boundaries.

Choosing the Representation and Its Limits

The direct survival likelihood and the Poisson representation are equivalent, up to factors fixed by the observed data, when the piecewise-constant hazard and exposure construction are correct. A direct survival formulation makes event times and integrated hazards explicit; the Poisson formulation can be convenient when the model is to be expressed through INLA’s Poisson likelihood. Neither representation repairs an incorrect hazard specification or incorrect risk-time data.

The piecewise model approximates a smoothly changing baseline hazard by a set of constant hazards. More intervals allow finer time variation but can leave little event information per interval and can make estimates sensitive to the baseline structure. Fewer intervals are simpler but may impose an unrealistic constant rate over long periods. Inspect interval-specific event counts and exposure, and assess whether conclusions are sensitive to reasonable cutpoint choices.

A further limitation arises when the log hazard changes within an interval, for example because a time-varying covariate or a longitudinal current-value association changes continuously. In that case the exact cumulative hazard is an integral of the time-varying hazard, not generally \(E_{ik}\exp(\eta_{ik})\). Treating \(\eta_{ik}\) as constant is then an approximation; finer intervals or a likelihood that integrates the changing hazard may be needed. A good numerical fit alone does not establish that this approximation is adequate.

  • Wrong: use the full interval width as exposure for every row. Correction: use only time actually at risk, including a partial final interval.
  • Wrong: enter \(\log(E_{ik})+\eta_{ik}\) as an ordinary predictor while also specifying an offset. Correction: include \(\log(E_{ik})\) once as the offset; \(\eta_{ik}\) is the modeled log hazard.
  • Wrong: assume any observed event is automatically assigned to a row. Correction: check the cutpoint convention and ensure every event time is strictly greater than \(a_0\), or extend the cutpoints below it.
  • Wrong: interpret the interval Poisson counts as repeated independent terminal events. Correction: they encode the one-event survival likelihood over the observed at-risk intervals.
Key takeaway: For a piecewise-constant hazard, give each at-risk person-interval a count \(d_{ik}\), exposure \(E_{ik}\), and offset \(\log(E_{ik})\). Correct event assignment, partial-interval exposure, and cutpoint coverage are essential to the likelihood equivalence.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A person is censored at time 2.3 with cuts \(0,1,2,3\). What are the exposures and event counts?
  2. For a row with exposure \(0.25\) time units and log hazard \(\eta=\log(0.08)\), calculate its Poisson mean and offset.
  3. Under intervals \((0,1]\), \((1,2]\), an event is observed at time 1. Which interval receives the event count?
  4. Why does the Poisson likelihood have the same parameter-dependent part as the piecewise survival likelihood?

Solutions. 1. The exposures are \(1,1,0.3\), and all counts are zero because follow-up is censored without an observed event. 2. The mean is \(0.25(0.08)=0.020\); the offset is \(\log(0.25)\approx-1.386\). 3. The event is assigned to \((0,1]\), the interval ending at time 1; it is counted once. 4. Substituting \(\mu_{ik}=E_{ik}\exp(\eta_{ik})\) into the Poisson likelihood gives the survival factor \(\exp\{d_{ik}\eta_{ik}-E_{ik}\exp(\eta_{ik})\}\), multiplied by \(E_{ik}^{d_{ik}}/d_{ik}!\), which does not depend on model parameters.

Clinical Biostats