Tutorials › Competing Risks and Multi-State Models › Memory Across Repeated Visits To A State

Semi-Markov and Non-Markov Models · Tutorial 335 of 699

Memory Across Repeated Visits To A State

Learn to specify when state-entry duration resets and when prior episodes or accumulated illness burden continue to affect transition risks.

Advanced 12 min read

What You'll Learn

  • Define a current-state visit and its duration in a recurrent illness path.
  • Separate resetting the current-sojourn clock from retaining information about earlier visits.
  • Formulate reset-only and history-retaining transition intensities.
  • Calculate how episode counts and accumulated illness time change conditional relapse risk.
  • Diagnose when repeated-visit patterns are poorly represented by a reset-only model.

Why Memory Across Visits Needs an Explicit Rule

In a recurrent illness process, a person may move from well to ill, recover, and later become ill again. On entering a state for a new episode, should the model treat that visit as a fresh start? Or should the risk of another transition depend on the person’s earlier episodes? These are distinct modelling decisions. A model can reset the clock measuring time in the current state while still retaining the number or duration of earlier episodes.

This distinction matters because two people can occupy the same state for the same length of time and still have different observed histories. If those histories predict different transition intensities, a model that treats the people as identical omits that predictive information. The formulation below makes the current-visit clock and retained history separate ingredients.

Definition: A visit to state \(r\) is a continuous spell in that state, from entry until the next transition out. If the current visit began at time \(T_r(t)\), its sojourn age at time \(t\) is \(A(t)=t-T_r(t)\). A reset-only model allows transition intensities to depend on the current state and its current sojourn age, but not on earlier visits once those quantities are given. A history-retaining model also allows them to depend on specified features of earlier visits.

Notation for a Recurrent Illness Process

Consider three states: \(0\) for well, \(1\) for ill, and \(2\) for dead. State \(2\) is absorbing. The possible transitions are \(0\to1\) (illness onset or relapse), \(1\to0\) (recovery), \(0\to2\), and \(1\to2\). A path can revisit states \(0\) and \(1\), but cannot leave state \(2\).

Write \(H(t-)\) for the observed path history immediately before time \(t\). For a person currently in state \(r\), let \(T_r(t)\) be the start time of the current visit and \(A(t)=t-T_r(t)\) its age. Let \(K_1(t-)\) be the number of entries into the illness state before \(t\), and let \(B_1(t-)\) be the total time spent ill before \(t\). These two summaries encode different aspects of previous illness: \(K_1\) counts episodes, while \(B_1\) measures accumulated illness duration.

For \(r\ne s\), the transition intensity \(\lambda_{rs}(t\mid H(t-))\) is the instantaneous rate of transition from \(r\) to \(s\) at time \(t\), conditional on being in \(r\) just before \(t\) and on the specified history. A reset-only semi-Markov formulation can be written

$$ \lambda_{rs}(t\mid H(t-))=\lambda^{(0)}_{rs}\{A(t)\}, \qquad X(t-)=r. $$

Here the current sojourn age starts at zero on every entry into the state. The model imposes the additional condition that earlier visits do not affect the intensity after current state and age are fixed. A history-retaining version can include selected history summaries:

$$ \lambda_{rs}(t\mid H(t-)) = \lambda^{(0)}_{rs}\{A(t)\} \exp\!\left\{\theta_{rs}K_1(t-)+\gamma_{rs}B_1(t-)\right\}, \qquad X(t-)=r. $$

The exponential form ensures a nonnegative intensity. The coefficients \(\theta_{rs}\) and \(\gamma_{rs}\) are transition-specific: a history feature may predict relapse without having the same association with recovery or death. Units must be handled consistently. If \(B_1\) is measured in years, then \(\gamma_{rs}\) is per year of prior illness time, while the episode count \(K_1\) is dimensionless.

A retained history feature must be known just before time \(t\); it cannot use future transitions. Also, an intensity is defined only while the person is at risk for that transition. In particular, no outgoing transition intensity is specified from the absorbing death state.

Worked Example: Recording a Recurrent Path

Suppose a hypothetical patient starts well at time \(0\), is ill from year \(1.0\) to year \(1.5\), is well from year \(1.5\) to year \(3.0\), and is ill again from year \(3.0\) to year \(4.0\). The patient is then well at time \(5.25\), with no transition since year \(4.0\).

Current state and age. At year \(5.25\), the patient is in state \(0\). The current well visit began at year \(4.0\), so \(A(5.25)=5.25-4.0=1.25\) years.

Episode count. There have been two entries into state \(1\), at years \(1.0\) and \(3.0\). Thus \(K_1(5.25-)=2\).

Accumulated illness time. The first illness spell lasted \(1.5-1.0=0.5\) years and the second lasted \(4.0-3.0=1.0\) year. Therefore \(B_1(5.25-)=0.5+1.0=1.5\) years.

A reset-only model for relapse uses the current well-state age of \(1.25\) years but does not use the two earlier illness episodes or their total duration. A history-retaining model could additionally use \(K_1=2\), \(B_1=1.5\), or another specified summary. The path alone does not decide which formulation is appropriate.

What Resets, and What Is Retained?

The word “reset” refers to a defined quantity, not necessarily to the person’s entire history. When a person returns to state \(0\), the age \(A(t)\) for the new well visit is zero at entry and then increases with time in that visit. The same is true for a new illness visit. This is the ordinary state-sojourn clock. A reset-only model also leaves prior visit information out of the transition intensity. A history-retaining model can use that same reset clock and separately carry forward episode counts or prior exposure.

For example, suppose relapse intensity depends on the duration of the current well visit and the number of previous illness episodes. Then the clock resets on every return to well, but \(K_1\) does not reset. By contrast, if the scientific question concerns accumulated burden, \(B_1\) continues to increase over illness visits and does not fall when a person recovers. These summaries are not interchangeable: equal episode counts can conceal very different episode durations, and equal cumulative durations can arise from different numbers of episodes.

Worked Example: Episode Count and the Relapse Intensity

Assume, hypothetically, that the baseline relapse intensity for someone in a current well visit of age \(a\) is \(\lambda^{(0)}_{01}(a)=0.20\) per year. Consider a model in which each previous illness episode multiplies this intensity by \(1.5\), so \(\theta_{01}=\log(1.5)\), and cumulative illness duration has no effect (\(\gamma_{01}=0\)).

For a person in a well visit of age \(1.25\) years with \(K_1=2\), the model gives

$$ \lambda_{01} =0.20\exp\{\log(1.5)\times2\} =0.20(1.5)^2 =0.45\ \text{per year}. $$

For a person at the same current well-visit age but with no previous illness episodes, the intensity is \(0.20\) per year. The model-implied intensity ratio is \(0.45/0.20=2.25\). This is a conditional association specified by the model, not evidence that earlier episodes cause later relapse. It also does not say that the probability of relapse over an entire year is \(0.45\); an intensity is an instantaneous rate.

The formulation assumes that the relevant prior episode count is available at each time, that the baseline intensity and the log-linear count effect are appropriate, and that other needed predictors are either included or not required for the stated model. The numerical calculation illustrates a stipulated model; it does not establish that these assumptions hold in observed data.

From Intensities to Conditional Transition Probabilities

A transition intensity describes a local rate. To obtain a probability over an interval, account for the possibility of remaining in the state and for all competing exits. Suppose the patient is in state \(r\) at the start of an interval and, over the interval, the cause-specific intensities \(\lambda_{rs}\) are constant for each possible destination \(s\). If there are no other transitions, the total exit intensity is \(\Lambda_r=\sum_{s\ne r}\lambda_{rs}\). The probability of an exit to destination \(s\) by interval length \(\Delta\), before any other exit, is

$$ P(\text{first exit is to }s\text{ by }\Delta) = \frac{\lambda_{rs}}{\Lambda_r} \left\{1-\exp(-\Lambda_r\Delta)\right\}. $$

The formula assumes constant intensities over this interval and conditioning on the specified current history. It is not a general formula for arbitrary time-varying intensities; in that case the relevant intensities must be integrated over time.

For justification, let \(S(u)\) be the probability of no exit from state \(r\) during the next \(u\) time units, conditional on the starting history. In a short interval of length \(du\), the chance of any exit is \(\Lambda_rdu+o(du)\). Therefore \(S(u+du)=S(u)\{1-\Lambda_rdu+o(du)\}\), giving \(dS(u)/du=-\Lambda_rS(u)\), with \(S(0)=1\). Solving yields \(S(u)=\exp(-\Lambda_ru)\). The probability density that the first exit is to \(s\) at time \(u\) is \(S(u)\lambda_{rs}\); integrating it gives \(\int_0^\Delta \exp(-\Lambda_ru)\lambda_{rs}\,du\), which is the stated expression.

Worked Example: Relapse Probability With Competing Death

Continue with the hypothetical relapse intensities above. Suppose a person in a well visit has a constant death intensity of \(0.05\) per year over the next \(0.5\) year. Assume both intensities remain constant over that interval, and compare a person with \(K_1=0\) to one with \(K_1=2\). There are two possible exits from state \(0\): relapse and death.

For \(K_1=0\), the relapse intensity is \(0.20\) per year and the total exit intensity is \(0.20+0.05=0.25\) per year. The conditional probability of relapse before death and within \(0.5\) year is

$$ \frac{0.20}{0.25}\left(1-\exp\{-0.25(0.5)\}\right) =0.8(1-\exp\{-0.125\}) \approx 0.0940. $$

For \(K_1=2\), the relapse intensity is \(0.45\) per year, so the total exit intensity is \(0.45+0.05=0.50\) per year. The corresponding probability is

$$ \frac{0.45}{0.50}\left(1-\exp\{-0.50(0.5)\}\right) =0.9(1-\exp\{-0.25\}) \approx 0.1991. $$

Under the stipulated model, the higher episode count corresponds to a larger conditional probability of relapse before death within the next half-year: about \(19.9\%\), compared with \(9.40\%\). These are model-based probabilities conditional on the stated starting histories and constant-intensity assumptions. They are not probabilities that the model is true.

Diagnostics, Alternatives, and Limitations

A reset-only formulation is inadequate if, after accounting for current state and current sojourn age, relevant previous-visit information still predicts transition intensity. One practical diagnostic is to compare estimated transition patterns across episode counts at similar current-state ages, while accounting for other observed predictors. For example, among people currently well for about one year, compare relapse patterns for those with zero, one, or several prior illness episodes. A pattern that persists across comparable risk sets can motivate a history-retaining formulation; it does not by itself prove a causal effect.

Also examine whether history summaries are measured consistently, whether there are enough people with repeated episodes to support comparisons, and whether the assumed functional form is plausible. A linear effect of episode count on the log intensity may be too restrictive if the first recurrence matters more than later ones. Cumulative illness time and episode count may be strongly related, making their separate effects difficult to estimate. Apparent history effects can also reflect unmeasured differences between people, such as persistent susceptibility, rather than a direct effect of the recorded history.

The main alternatives encode different amounts or forms of information:

FormulationWhat determines the intensityWhat it leaves out or adds
Reset-only semi-MarkovCurrent state and current-visit ageEarlier visits do not enter once these are fixed.
History-retaining intensityCurrent state, current-visit age, and chosen history summariesRetains selected features such as episode count or accumulated illness time.
State augmentationCurrent expanded state, potentially including visit or history categoriesRepresents selected history in the state definition, at the cost of a larger state space.

These formulations are not interchangeable by definition. A count retains how many illness episodes occurred but not their timing; cumulative duration retains total time ill but not how that time was divided among episodes. State augmentation can represent more detailed history, but may create many states and sparse data. Any chosen summary discards some aspects of the full path.

The conditional intensity framework also does not automatically handle every source of dependence. For example, unobserved person-specific susceptibility may make recurrent transitions dependent even after the recorded history summaries are included. Observation times, interval-censored transitions, and loss to follow-up may require additional modelling or estimation considerations. The formulation describes how a specified observed history enters an intensity; it does not remove the need to examine data quality and assumptions.

Common mistake: “The person returned to the well state, so all history has reset.” The correction is to specify what resets. The clock \(A(t)\) for the current well visit begins again at entry, but previous episode count \(K_1\) and accumulated illness time \(B_1\) can still be available predictors. Conversely, retaining history does not mean the current-visit clock must continue from an earlier visit.

Key takeaway: Write the current state, current-visit age, and retained history summaries as separate parts of the transition-intensity specification. This makes the model’s memory rule explicit and its implications interpretable.

Check Your Understanding

Answer each question using the recurrent illness process above. Full solutions follow the questions.

  1. A person has completed three illness episodes and is currently well, 0.75 years after recovery. What are \(K_1\) and the current well-visit age?
  2. Under a reset-only model, do two people with the same current state and visit age necessarily have the same specified relapse intensity? What extra assumption is being made?
  3. A model has baseline relapse intensity \(0.10\) per year and each prior illness episode multiplies it by \(1.2\). Find the intensity for a person with two prior episodes.
  4. Why is it incorrect to interpret a relapse intensity of \(0.30\) per year as a 30% probability of relapse during the next year?

Solutions. (1) \(K_1=3\), and the current well-visit age is \(0.75\) years. The count refers to previous illness entries; the age refers only to the current well visit. (2) Yes, under the reset-only specification, provided other included predictors are also the same. The model assumes that earlier visits do not further affect relapse intensity once current state and current-visit age are fixed. (3) The intensity is \(0.10(1.2)^2=0.144\) per year. (4) Intensity is an instantaneous rate, not a one-year probability. Even with a constant single-event intensity of \(0.30\) per year and no competing exits, the one-year event probability is \(1-\exp(-0.30)\approx0.259\), not \(0.30\). With competing exits, the cause-specific probability also depends on their intensities.

Clinical Biostats