Tutorials › Bayesian Clinical Trials › Gamma Updates For Exponential Event-Time Rates

Posterior Computation · Tutorial 113 of 696

Gamma Updates For Exponential Event-Time Rates

Learn how to update a Gamma prior for an exponential event-time rate using observed events and total follow-up, including what right censoring contributes and when the update is appropriate.

Intermediate 10 min read

What You'll Learn

  • Define the exponential event-time model and right-censoring data used in the update
  • Derive the likelihood kernel from observed event and censoring contributions
  • Update a Gamma prior using the number of events and total observed follow-up time
  • Interpret the posterior rate, mean, variance, and mode with appropriate units
  • Check assumptions and recognize when a constant-rate model is unsuitable
  • Distinguish this event-time update from count-based and nonconstant-hazard approaches

Why Censored Follow-Up Still Informs the Rate

In a clinical trial, some participants experience the event of interest during observation, while others leave follow-up or reach the study end without an observed event. The latter observations are right-censored: they do not tell us the eventual event time, but they do tell us that the participant remained event-free up to a known time. Under a constant-rate exponential model, that time contributes information about the event rate.

The update in this tutorial reduces the data to two quantities: the number of observed events and the total time participants were observed at risk. It is important to distinguish total follow-up from the sum of event times alone. Censored participants contribute their observed follow-up time to the total.

Definition: Suppose participant \(i\) has event time \(T_i\sim \operatorname{Exponential}(\lambda)\), with rate \(\lambda>0\). The exponential model has density \(f(t\mid\lambda)=\lambda e^{-\lambda t}\) and survival function \(S(t\mid\lambda)=e^{-\lambda t}\), for \(t\geq 0\). For right-censored observations, record \(Y_i=\min(T_i,C_i)\) and \(\delta_i=1\) if the event is observed, or \(\delta_i=0\) if the participant is censored. Here \(C_i\) is the censoring time.

The rate \(\lambda\) is an event rate per unit of time; for example, if time is measured in months, its units are events per participant-month. Under the exponential model, the hazard is constant at \(\lambda\), and the mean event time is \(1/\lambda\). The model assumes independent participants with the same event-time rate. The censoring mechanism must be noninformative for this likelihood: in particular, censoring must not provide unmodelled information about a participant’s event time. Independent administrative censoring is a common setting in which censoring is ignorable.

Assume event times are observed exactly when events occur, and that observations are right-censored rather than interval-censored. These assumptions matter: a simple exponential likelihood is not automatically appropriate for other observation schemes or for event rates that vary over time.

Likelihood From Events and Censoring

For an observed event at time \(y_i\), the event-time contribution is the density \(f(y_i\mid\lambda)=\lambda e^{-\lambda y_i}\). For a participant censored at time \(y_i\), the contribution is the probability of remaining event-free through that time, \(S(y_i\mid\lambda)=e^{-\lambda y_i}\). Thus an observed event contributes one factor of \(\lambda\), while both event and censored observations contribute their observed time in the exponential term.

$$ L(\lambda\mid \mathbf{y},\boldsymbol{\delta}) =\prod_{i=1}^{n}\left[\lambda^{\delta_i}e^{-\lambda y_i}\right] =\lambda^d e^{-\lambda T}, \qquad d=\sum_{i=1}^{n}\delta_i,\quad T=\sum_{i=1}^{n}y_i. $$

Here \(d\) is the observed event count and \(T\) is the total observed follow-up time. The likelihood expression omits factors involving only the censoring process; under the stated noninformative-censoring condition, those factors do not depend on \(\lambda\) and so do not change the posterior for \(\lambda\). This is why censored follow-up contributes through \(T\), even though a censored participant contributes no event factor.

Use a Gamma prior parameterized by shape \(a>0\) and rate \(b>0\). In this convention the density is proportional to \(\lambda^{a-1}e^{-b\lambda}\), and \(b\) has units of time so that \(b\lambda\) is dimensionless.

Definition: If \(\lambda\sim\operatorname{Gamma}(a,b)\), with shape \(a\) and rate \(b\), its density is $$ \pi(\lambda)=\frac{b^a}{\Gamma(a)}\lambda^{a-1}e^{-b\lambda},\qquad \lambda>0. $$ The parameter \(b\) is a rate parameter for the Gamma distribution, not a scale parameter.

Deriving the Posterior Update

Bayes’ rule says that the posterior density is proportional to the likelihood times the prior density. Combining the likelihood kernel with the Gamma prior gives a kernel with the same form as a Gamma density.

1
Write the likelihood kernel.
For \(d\) observed events and total observed follow-up \(T\), \(L(\lambda)\propto\lambda^d e^{-\lambda T}\).
2
Multiply by the prior kernel.
The prior kernel is \(\lambda^{a-1}e^{-b\lambda}\), so the product is \(\lambda^{a+d-1}e^{-(b+T)\lambda}\).
3
Identify the Gamma parameters.
The resulting power and exponential term are the kernel of a Gamma distribution with shape \(a+d\) and rate \(b+T\).
Theorem: Under the exponential event-time model, independent observations, ignorable right censoring, and a \(\operatorname{Gamma}(a,b)\) prior on the common rate \(\lambda\), the posterior is $$ \lambda\mid\mathbf{y},\boldsymbol{\delta}\sim \operatorname{Gamma}(a+d,\ b+T), \qquad d=\sum_{i=1}^{n}\delta_i,\quad T=\sum_{i=1}^{n}y_i. $$

The update can also be justified by normalization. The unnormalized posterior kernel is \(\lambda^{a+d-1}e^{-(b+T)\lambda}\). Its integral over positive \(\lambda\) is \(\Gamma(a+d)/(b+T)^{a+d}\), so multiplying by \((b+T)^{a+d}/\Gamma(a+d)\) produces a proper density. This verifies both the posterior parameters and the normalizing constant.

For a Gamma distribution with shape \(A\) and rate \(B\), the mean is \(A/B\), the variance is \(A/B^2\), and, when \(A>1\), the mode is \((A-1)/B\). Therefore the posterior mean rate is \((a+d)/(b+T)\), with units of inverse time. A credible interval can be obtained from the corresponding posterior Gamma quantiles; its endpoints are rates, not event times.

Worked Example: Events and Censoring in a Hypothetical Trial

Suppose eight hypothetical participants are followed for months. Five have observed events at months 2, 3, 5, 7, and 8. Three are censored at months 4, 6, and 7. Use a \(\operatorname{Gamma}(2,20)\) prior, where the rate parameter 20 is measured in months.

The event count is \(d=5\). Total observed follow-up includes all eight participants: \(T=2+3+5+7+8+4+6+7=42\) participant-months. The censoring times are included, because each censored participant was known to remain event-free until that time.

Applying the update gives $$ \lambda\mid\text{data}\sim\operatorname{Gamma}(2+5,20+42) =\operatorname{Gamma}(7,62). $$

The posterior mean event rate is \(7/62=0.1129\) events per participant-month. Since the shape is greater than one, the posterior mode is \((7-1)/62=0.09677\) events per participant-month. These are summaries of uncertainty about the common rate under the model; they are not estimates of a treatment effect.

Further Worked Updates

Worked Example: A Small Hypothetical Follow-Up Dataset

In a hypothetical study, three participants have observed events at days 2, 5, and 8. Two others are censored at days 4 and 10. Suppose the prior is \(\operatorname{Gamma}(1.5,12)\), with \(b=12\) days.

There are \(d=3\) observed events. The total follow-up is \(T=2+5+8+4+10=29\) participant-days. In particular, the two censoring times contribute \(4+10\) days, not zero.

The posterior is $$ \lambda\mid\text{data}\sim\operatorname{Gamma}(1.5+3,12+29) =\operatorname{Gamma}(4.5,41). $$

Its mean is \(4.5/41=0.1098\) events per participant-day, and its variance is \(4.5/41^2=0.002677\) in squared inverse-day units. Since the posterior shape exceeds one, its mode is \(3.5/41=0.08537\) events per participant-day. The posterior and its summaries depend on the chosen prior as well as on the observed event count and exposure.

Worked Example: Checking Units and the Effect of Follow-Up

Consider six hypothetical participants followed in days. Events occur on days 12 and 18; the other four participants are censored on days 20, 25, 30, and 15. Use a \(\operatorname{Gamma}(3,60)\) prior, where \(b=60\) days.

The total follow-up is \(T=12+18+20+25+30+15=120\) participant-days, and \(d=2\). Thus $$ \lambda\mid\text{data}\sim\operatorname{Gamma}(3+2,60+120) =\operatorname{Gamma}(5,180). $$

The posterior mean rate is \(5/180=0.02778\) events per participant-day. The prior mean rate was \(3/60=0.05000\) events per participant-day. The posterior mean is lower here because the observed event count relative to total follow-up is \(2/120=0.01667\) events per participant-day. This comparison describes the update for this specified prior; it is not a test that the data establish a different population rate.

Assumptions, Diagnostics, and Alternatives

The compact update is useful because it requires only \(d\) and \(T\), but that convenience depends on substantive assumptions. The most consequential is a constant event hazard: under the exponential model, the instantaneous event rate does not change with time since the start of observation. The model also assumes a common rate for the observations being pooled and independent event times across participants. If rates differ systematically across participants or the hazard changes with time, the simple common-rate update may not describe the data adequately.

Censoring must also be handled appropriately. If participants leave follow-up because of a reason related to their unobserved event risk, and that dependence is not represented in the analysis, treating their times as ordinary noninformative censoring can bias inference. The algebraic update still produces a Gamma distribution, but that fact alone does not validate the model or the conclusions.

Useful checks include plotting or tabulating event occurrence over follow-up time, examining whether event rates appear to change across clinically meaningful time periods, and comparing follow-up patterns for censored and uncensored participants using available covariates. These checks cannot prove the assumptions, especially with few events, but marked time patterns or risk-related loss to follow-up should prompt caution. Prior predictive checks, as covered in the earlier material on prior predictive checks, can also reveal whether the chosen prior implies implausible event rates or follow-up outcomes before observing trial data.

This conjugate calculation differs from the Gamma-Poisson update for event counts. The exponential analysis uses event times and their total exposure: each event contributes a factor of \(\lambda\), and all observed time contributes exposure in the likelihood. Under a constant-rate process, the same count-and-exposure kernel is closely related to a Poisson count likelihood, but an analysis that keeps only a total count without correctly representing exposure can discard relevant information. An alternative survival model may allow a changing hazard, at the cost of a richer likelihood and additional modeling choices. The next material on piecewise-exponential survival likelihoods develops one such extension; it is not required for the conjugate update derived here.

Common Mistakes and Limitations

  • Ignoring censored follow-up. A censored participant does not contribute an event, but their observed time contributes to \(T\). Omitting it understates exposure and changes the posterior rate.
  • Using only event times in the total. \(T\) is the sum of all observed times \(Y_i\), for events and censored observations alike, not just event times.
  • Confusing Gamma rate and scale. In this tutorial \(b\) is the Gamma rate, so the posterior rate is \(b+T\). A scale-parameter convention would write the distribution differently.
  • Assuming conjugacy proves model fit. The posterior has a Gamma form because the likelihood and prior kernels combine that way. This does not establish a constant hazard, common rates, or noninformative censoring.
  • Misreading the posterior mean. It is a posterior expected rate under the model and prior, not a probability that the rate takes that value. A credible interval is a posterior probability statement conditional on the model and prior, unlike a frequentist confidence interval.

The method is limited to a single common exponential rate and the stated censoring setup. It does not by itself adjust for treatment arms, covariates, competing events, delayed entry, or a time-varying hazard. Those questions require an appropriately extended model rather than a mechanical reuse of this two-number update.

Check Your Understanding

Work through each question, then compare with the brief solutions below.

  1. A hypothetical sample has four observed events and total follow-up of 36 participant-weeks. With prior \(\operatorname{Gamma}(2,10)\), what is the posterior distribution, and what are the units of its rate parameter?
  2. One participant is censored after 9 days. What does this observation contribute to \(d\) and \(T\), assuming the censoring is ignorable?
  3. Explain why a constant Gamma posterior update does not demonstrate that the event hazard is constant over time.
  4. For prior \(\operatorname{Gamma}(1,20)\), suppose there are no observed events over 30 participant-days. Find the posterior and posterior mean rate.

Solutions. (1) The posterior is \(\operatorname{Gamma}(2+4,10+36)=\operatorname{Gamma}(6,46)\). Its rate parameter has units of participant-weeks, and the random event rate has units of inverse weeks. (2) It contributes zero to \(d\) and 9 participant-days to \(T\), because the participant was event-free through 9 days. (3) Conjugacy is an algebraic property of the specified likelihood and prior, not evidence that the model assumptions fit; the hazard may vary even though the assumed model yields a Gamma posterior. (4) Here \(d=0\) and \(T=30\), so the posterior is \(\operatorname{Gamma}(1,50)\), with mean \(1/50=0.02000\) events per participant-day.

Clinical Biostats