Signature
S_res = exp(-lambda * (tau + s)) / exp(-lambda * tau); t_med = log(2) / lambda
| Inputs | Definition | Unit |
|---|---|---|
lambda | Constant rate of leaving the state, the sum of the rates to every destination, above zero | per year |
tau | Time since entry to the state, zero or above | years |
s | Further time over which the person must stay, above zero | years |
S_res | Probability of staying in the state for a further time s after a time tau already spent there | probability |
|---|---|---|
t_med | Time since entry by which half of all stays in the state have ended | years |
Function
Memoryless transition property of a Markov state and the sojourn-time distribution it implies
Maps the state a person occupies at cycle t, the cycle itself and the path H_t before it to the probability of each next state, under the restriction that the path adds nothing once the current state and cycle are known. With a constant probability p_ii of staying in state i the restriction makes the number of cycles spent in i on one visit geometric, and in continuous time a constant exit rate makes the time spent in i exponential, so in both cases the chance of leaving does not depend on the time already spent in the state. The package gives the geometric distribution of a stay with its median, the residual-stay identity behind memorylessness with a check of a survival curve for time since entry, the exponential residual stay and median, and the gap between the discrete and continuous mean stays at the same rate. Existing records are cited and not restated. The mean episode length 1 divided by 1 minus p_jj is HE-FM-MKCH-002, the cohort update is HE-FM-MM-001 with the trace totals of HE-FN-CSIM-001 and HE-FM-CSIM-001, rate and probability conversion is HE-FN-TP-001 with HE-FM-TP-001 to HE-FM-TP-004 and HE-CF-TP-001 and HE-CF-TP-002, exponential survival and the mean 1 divided by lambda are HE-FM-BTH-003 and HE-FM-CONT-002, the fundamental matrix is HE-FM-ABS-001 with its discounted form HE-FM-MKCH-001 and HE-CF-MKCH-001, the six-month root of an annual matrix is HE-FM-TMAT-001, and relaxing the assumption with tunnel states is HE-FN-TUN-001, HE-FM-TUN-001 to HE-FM-TUN-003 and HE-CF-TUN-001. Notation follows the Markov Assumption article.
Try this function
Implementations
Excel
Exponential residual stay and median sojourn from named cells
With the total exit rate in ExitRate, the time already spent in TimeInState and the further time in ExtraTime, the formulas return S_res and t_med, the second held in a cell named MedianTime.
=EXP(-ExitRate*(TimeInState+ExtraTime))/EXP(-ExitRate*TimeInState); =LN(2)/ExitRate
Assumptions
Total exit rate constant over time since entry to the Markov state
Lambda is the sum of all cause-specific exit rates, as in the competing-hazards split of HE-FM-TP-004, and stays the same however long the person has been in the state. An exit hazard that rises or falls with time since entry, such as a Weibull hazard with a shape parameter other than 1, is not memoryless and needs tunnel states or a semi-Markov model.
Exit rate and times in one unit for the exponential Markov sojourn
Lambda per year is used with tau, s and t_med in years. Moving to months divides lambda by 12 and multiplies the times by 12, which leaves every probability unchanged.
Worked examples
Article's memoryless post-event state as an exponential sojourn
The stay probability 0.90613 corresponds to a constant death rate of about 0.098572 a year, minus log 0.90613 by HE-FM-TP-002. After one year in the state the chance of five more is about 0.6109, as from entry, and half of all stays have ended by about 7.03 years, against a mean of 1 divided by 0.098572, about 10.14 years (computed here for illustration).
lambda = 0.098572; tau = 1; s = 5; S_res = 0.6109; t_med = 7.0319
Sonnenberg and Beck's constant haemorrhage rate of 0.05 a year as an exponential sojourn
Sonnenberg and Beck note that a constant haemorrhage rate of 0.05 a year gives an average time to haemorrhage of 1 divided by 0.05, 20 years. The median is about 13.86 years, and after 10 event-free years the chance of 10 more is about 0.6065, the same as for the first 10 years (computed here for illustration).
lambda = 0.05; tau = 10; s = 10; S_res = 0.6065; t_med = 13.8629
Common errors
Median exponential sojourn taken as half the mean
At 0.05 a year half the mean is 10 years, but the median is log 2 divided by 0.05, about 13.86 years, so the shortcut understates it by about 28% (computed here for illustration). The median is about 0.693 of the mean at any constant rate.
Mean sojourn taken from one exit rate when a Markov state has competing exits
With an illustrative death rate of 0.05 and progression rate of 0.10 a year, the mean stay is 1 divided by 0.15, about 6.67 years, not the 20 years implied by the death rate alone, because every exit ends the stay (HE-FM-TP-004 and HE-FM-CONT-002).
Sources
Grinstead and Snell exponential density and its memoryless property
Grinstead CM, Snell JL. Grinstead and Snell's Introduction to Probability. The CHANCE Project version of 4 July 2006, based on the 2nd edition published by the American Mathematical Society. Chapter 5, section 5.2, Exponential and Gamma Densities, pages 205 to 207, which defines the density lambda e^(-lambda x), gives the distribution function F(x) = 1 minus e^(-lambda x) and shows that P(T > r + s | T > r) = P(T > s) = e^(-lambda s); and Chapter 2, Example 2.17, page 68, which states that the only continuous density with the memoryless property is the exponential.
Grinstead and Snell definition of the median and mean of an exponential variable
Grinstead CM, Snell JL. Grinstead and Snell's Introduction to Probability. The CHANCE Project version of 4 July 2006, based on the 2nd edition published by the American Mathematical Society. Chapter 5, section 5.2 exercises, Exercise 22, page 221, which defines the median of X as the value m with F(m) = 1/2 and asks for it for the exponential, giving log 2 divided by lambda from F above; and Chapter 6, section 6.3, Example 6.26, page 273, which shows that E(X) = 1/lambda.
Sonnenberg and Beck on the average time to an event at a constant rate
Sonnenberg FA, Beck JR. Markov models in medical decision making: a practical guide. Medical Decision Making. 1993;13(4) 322-338. Page 323, which states that if the rate of haemorrhage is a constant 0.05 per person per year the average time before a haemorrhage is 1/0.05 or 20 years.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
