Exponential event time by inverse transform

Samples a time to an event with a constant hazard lambda_j from a uniform random number U. The function log is the natural logarithm.

Signature

T_j = -log(U) / lambda_j
Inputs
InputsDefinitionUnit
URandom number drawn from a uniform distribution between 0 and 1, excluding 0no unit
lambda_jConstant rate of event j for the patient, which may depend on the patient's attributesevents per person per unit of time
Output
T_jSimulated time from the current clock time to the next occurrence of event j for one patienttime, in the unit of lambda_j

Function

Event time sampling function

Maps a uniform random number and a fitted time-to-event distribution to a sampled time to the next event for one simulated patient. The sampled time is the value at which the survival function equals the random number, so repeated draws reproduce the fitted distribution. The simulation clock then advances to the earliest scheduled event.

Implementations

  • Excel

    Exponential time to event in one cell

    Excel RAND returns values from 0 up to but not including 1, so 1 minus RAND is used to avoid LN(0). A fixed draw in the named cell UniformDraw is used when results must be reproducible.

    =-LN(1-RAND())/Rate; =-LN(UniformDraw)/Rate

Assumptions

  • Constant hazard for the event

    The hazard of event j is constant from the current clock time onwards. A hazard that changes with age or time since an event needs another distribution, such as the Weibull, or an inverse cumulative-hazard method.

  • Next-event advance of the clock

    Candidate times are sampled for every event the patient is at risk of, the clock moves to the earliest, that event's logic is executed, and events made impossible, such as a follow-up visit after death, are cancelled. Ties follow a documented priority rule.

  • Independent or deliberately shared random numbers

    Each U comes from a separate draw, except where common random numbers are used on purpose so that the same simulated patient receives the same draws in each strategy being compared.

Worked examples

  • Constant hazard of 0.15 per year

    With U of 0.30 and a hazard of 0.15 per year, the sampled time to the event is about 8.0265 years.

    U = 0.30; lambda_j = 0.15; T_j = 8.0265
  • Median draw at a hazard of 0.10 per year

    A draw of U equal to 0.50 returns the median of the distribution, about 6.9315 years at a hazard of 0.10 per year, which is ln 2 divided by the hazard.

    U = 0.50; lambda_j = 0.10; T_j = 6.9315

Common errors

  • Assigning every patient the mean time

    Using 1 divided by the rate as every patient's event time removes between-patient variation. When costs or QALYs depend non-linearly on event time, for example through discounting or a time horizon, the average result is then biased.

  • Using a per-cycle probability as the hazard

    lambda_j is a rate. Entering a probability per cycle, or a rate in a different time unit, gives sampled times on the wrong scale. A rate per year yields times in years.

  • Leaving obsolete events on the calendar

    If events scheduled before death are not cancelled, the model can accrue follow-up costs or progression after the absorbing event.

Sources

  • NICE DSU guidance on sampling event times in a DES

    Davis S, Stevenson M, Tappenden P, Wailoo A. NICE DSU Technical Support Document 15: Cost-effectiveness modelling using patient-level simulation. Sheffield: Decision Support Unit, ScHARR, University of Sheffield; April 2014. Section 4.5 Techniques required to implement a DES, Table 1 (sample from an exponential with scale beta as minus beta times ln(U), where U is a uniform random number).

    View source →

  • Inverse-transform generation of random variates

    Law AM. Simulation Modeling and Analysis. 5th ed. New York: McGraw-Hill Education; 2015.

    View source →

  • ISPOR-SMDM good practice for discrete event simulation

    Karnon J, Stahl J, Brennan A, Caro JJ, Mar J, Möller J. Modeling using discrete event simulation: a report of the ISPOR-SMDM Modeling Good Research Practices Task Force-4. Value in Health. 2012;15(6):821-827.

    View source →

Canonical Identity

Stable URI · Machine-readable · Resolvable · CC BY 4.0