Tutorials › Competing Risks and Multi-State Models › Piecewise-Constant Intensities And Matrix Exponentials

Transition Intensities and Probabilities · Tutorial 296 of 699

Piecewise-Constant Intensities And Matrix Exponentials

Use matrix exponentials for constant-intensity intervals, multiply the resulting transition matrices in the correct order, and check the resulting probabilities.

Advanced 11 min read

What You'll Learn

  • Relate a valid transition-intensity matrix to transition probabilities over a constant-intensity interval.
  • Calculate a two-state transition matrix from its matrix exponential.
  • Combine interval-specific transition matrices across changes in the intensity matrix.
  • Explain why reversing the order of matrix multiplication can change the answer.
  • Check computed matrices for probability constraints and identify common numerical or modeling problems.

From Constant Intensities to Transition Probabilities

A transition-intensity matrix describes instantaneous rates of movement between states. Transition probabilities answer a different question: given the state at one time, what is the probability of each possible state at a later time? When the intensity matrix is constant over an interval, the matrix exponential connects these two quantities. If the intensities change between intervals, the interval-specific transition matrices must then be combined in chronological order.

This tutorial uses the row convention: rows of a transition matrix index the state at the beginning of an interval, and columns index the state at its end. A row vector of state probabilities is updated by multiplying on the right. This convention makes the order of interval multiplication especially important.

Definition: For a finite state space, a transition-intensity matrix \(Q\) has off-diagonal entries \(q_{ij}\geq 0\), where \(q_{ij}\) is the instantaneous intensity of moving from state \(i\) to state \(j\). Its diagonal entries satisfy \(q_{ii}=-\sum_{j\ne i}q_{ij}\), so each row sums to zero. If \(Q\) is constant for an interval of length \(d\), its transition-probability matrix is \(P(d)=\exp(Qd)\), where \(\exp\) denotes the matrix exponential.

The matrix exponential is defined by the convergent power series \(\exp(A)=I+A+A^2/2!+A^3/3!+\cdots\). It is not obtained by exponentiating each entry separately. For a finite-state, time-homogeneous continuous-time Markov model with a valid constant \(Q\), \(P(d)\) gives the probabilities of being in each destination state after \(d\) time units, conditional on each possible origin state.

The underlying Markov assumption is that, conditional on the current state, the future state evolution does not additionally depend on the earlier path. The intensities must be constant over the interval being modeled; \(Q\) must have nonnegative off-diagonal entries and zero row sums. In applications, the state definitions and time scale must also be appropriate, and any covariates that alter the intensities must be accounted for if the model is to represent the process being studied.

Why the Matrix Exponential Appears

A brief justification clarifies what the calculation represents. Write \(P(t)\) for the transition matrix over a constant-intensity interval of length \(t\). Over a sufficiently short additional duration \(h\), the transition matrix is \(I+hQ+o(h)\): a transition from \(i\) to \(j\ne i\) has probability \(q_{ij}h+o(h)\), while the diagonal term accounts for the probability of remaining in \(i\). The Markov property gives \(P(t+h)=P(t)(I+hQ+o(h))\). Taking the derivative yields the matrix differential equation below.

$$ \frac{dP(t)}{dt}=P(t)Q,\qquad P(0)=I. $$

The power series for \(\exp(Qt)\) can be differentiated term by term and gives \(\frac{d}{dt}\exp(Qt)=\exp(Qt)Q\), with \(\exp(Q\cdot 0)=I\). Thus it solves this initial-value problem, giving the stated transition matrix. This justification is for a constant \(Q\); it does not say that one can use a single exponential of an averaged intensity matrix when intensities vary over time.

Calculating and Combining Intervals

Suppose the intensity matrix is \(Q_1\) from time \(t_0\) to \(t_1\), then \(Q_2\) from \(t_1\) to \(t_2\), continuing through \(Q_m\) to \(t_m\). Let \(d_k=t_k-t_{k-1}\). Each interval has transition matrix \(P_k=\exp(Q_kd_k)\). With the row convention, the overall transition matrix is their product in chronological order:

$$ P(t_0,t_m)=P_1P_2\cdots P_m =\exp(Q_1d_1)\exp(Q_2d_2)\cdots\exp(Q_md_m). $$

This follows by conditioning on the state at each interval boundary: the probability of moving from an initial state to a final state is summed over the possible intermediate states. Matrix multiplication performs exactly that sum. If \(\boldsymbol{\pi}(t_0)\) is a row vector of initial-state probabilities, then \(\boldsymbol{\pi}(t_m)=\boldsymbol{\pi}(t_0)P(t_0,t_m)\).

Worked Example: A Two-State Model With Constant Intensities

Consider two states, 0 and 1. Suppose the intensity of moving from 0 to 1 is \(a=0.4\) per year and the intensity of moving from 1 to 0 is \(b=0.2\) per year, both constant for three years. The intensity matrix is \(Q=\begin{pmatrix}-0.4&0.4\\0.2&-0.2\end{pmatrix}\). Both rates are nonnegative and each row sums to zero, so \(Q\) is a valid intensity matrix.

For this two-state model, the matrix exponential over duration \(d\) has entries \(P_{00}=\frac{b}{a+b}+\frac{a}{a+b}e^{-(a+b)d}\), \(P_{01}=\frac{a}{a+b}(1-e^{-(a+b)d})\), \(P_{10}=\frac{b}{a+b}(1-e^{-(a+b)d})\), and \(P_{11}=\frac{a}{a+b}+\frac{b}{a+b}e^{-(a+b)d}\). Substituting \(d=3\), \(a+b=0.6\), and \(e^{-1.8}=0.1653\) gives:

$$ P(3)= \begin{pmatrix} \frac{0.2}{0.6}+\frac{0.4}{0.6}(0.1653) & \frac{0.4}{0.6}(1-0.1653)\\ \frac{0.2}{0.6}(1-0.1653) & \frac{0.4}{0.6}+\frac{0.2}{0.6}(0.1653) \end{pmatrix} \approx \begin{pmatrix} 0.4435&0.5565\\ 0.2782&0.7218 \end{pmatrix}. $$

Starting in state 0, the probability of being in state 1 after three years is approximately 0.5565. Starting in state 1, the probability of being in state 0 after three years is approximately 0.2782. Each row sums to 1, as required for a transition-probability matrix.

Worked Example: Two Intervals With Competing Absorbing States

Suppose state 0 is an initial state and states 1 and 2 are absorbing event states. For the first two years, the intensities from state 0 to states 1 and 2 are 0.2 and 0.1 per year. For the next three years, they are 0.1 and 0.3 per year. These are hypothetical rates. In each interval the off-diagonal rates are nonnegative, and the diagonal entry in row 0 is minus their sum; the absorbing rows have all entries zero.

In the first interval the total exit intensity is 0.3 per year, so the probability of remaining in state 0 for two years is \(e^{-0.3(2)}=e^{-0.6}=0.5488\). The probabilities of reaching states 1 and 2 are the respective intensity shares of the probability of leaving state 0. Thus:

$$ P_1= \begin{pmatrix} 0.5488&\frac{0.2}{0.3}(1-0.5488)&\frac{0.1}{0.3}(1-0.5488)\\ 0&1&0\\ 0&0&1 \end{pmatrix} \approx \begin{pmatrix} 0.5488&0.3008&0.1504\\ 0&1&0\\ 0&0&1 \end{pmatrix}. $$

For the second interval, the total exit intensity is 0.4 per year and the duration is three years. The probability of remaining in state 0 is \(e^{-0.4(3)}=e^{-1.2}=0.3012\). The event-state probabilities are \(0.1/0.4\) and \(0.3/0.4\) times \(1-0.3012=0.6988\), giving:

$$ P_2\approx \begin{pmatrix} 0.3012&0.1747&0.5241\\ 0&1&0\\ 0&0&1 \end{pmatrix}. $$

The full five-year transition matrix is \(P_1P_2\), not \(P_2P_1\). Multiplying the first row gives approximately \((0.5488)(0.3012)=0.1653\) for remaining in state 0, \((0.3008)+(0.5488)(0.1747)=0.3967\) for ending in state 1, and \((0.1504)+(0.5488)(0.5241)=0.4380\) for ending in state 2. The first terms in the latter two probabilities represent individuals who entered those absorbing states in the first interval; only those remaining in state 0 can experience the second interval's exits.

Thus, starting in state 0, the five-year probabilities are approximately 0.1653, 0.3967, and 0.4380 for states 0, 1, and 2. They sum to 1. The absorbing states remain absorbing throughout, which is consistent with the specified model.

Multiplication Order and a Direct Check

Interval matrices generally do not commute: \(P_1P_2\) need not equal \(P_2P_1\). A short example shows why chronological order is substantive, not just a bookkeeping preference. Suppose there are three states and only the transition 0 to 1 can occur in the first one-unit interval, with intensity \(\log(2)\) per unit. In the second one-unit interval, only the transition 1 to 2 can occur, with intensity \(\log(4)\) per unit. State 2 is absorbing in both intervals. Each interval matrix follows from its exponential; the nonzero transition probability in the first interval is \(1-e^{-\log(2)}=0.5\), and in the second it is \(1-e^{-\log(4)}=0.75\).

$$ P_1= \begin{pmatrix} 0.5&0.5&0\\ 0&1&0\\ 0&0&1 \end{pmatrix}, \qquad P_2= \begin{pmatrix} 1&0&0\\ 0&0.25&0.75\\ 0&0&1 \end{pmatrix}. $$

In chronological order, the probability of moving from state 0 to state 2 is \(0.5(0.75)=0.375\), so the first row of \(P_1P_2\) is \((0.5,0.125,0.375)\). Reversing the order would imply that the 1-to-2 transition happened before the 0-to-1 transition; it gives first row \((0.5,0.5,0)\). That is a different process, and it misses the chance to move from state 1 to state 2.

Checks, Alternatives, and Limitations

A computed matrix should be checked against the model and basic probability requirements. For each interval matrix and the combined matrix, check that entries are between 0 and 1 up to numerical rounding, and that each row sums to 1. Also check that the diagonal entries of each input \(Q_k\) are the negative sums of the off-diagonal entries in their rows. For a duration of zero, the result must be the identity matrix. These checks can expose an invalid intensity matrix, a multiplication-order error, or a faulty numerical calculation.

For small matrices, one can sometimes evaluate the exponential algebraically, as in the two-state example. For larger matrices, numerical matrix-exponential algorithms are preferable to truncating the power series by hand. If a matrix is estimated from data, numerical probability checks do not establish that the estimates are statistically reliable or that the model assumptions are appropriate. The exponential calculation itself also does not account for estimation uncertainty.

The matrix product integral is a general approach for accumulating transition changes over time and is used in settings where intensities may vary or are represented by event-time increments. For truly piecewise-constant intensities, the exponential within each interval gives a direct interval transition matrix. A fine time grid or numerical integration may be used when intensities vary continuously, but results can depend on the grid and numerical tolerances. A single exponential of an average \(Q\) is not generally a substitute for the ordered product of interval exponentials: changing intensities can change the process, and matrix multiplication order can matter.

The calculation is only as suitable as the model. If transition intensities vary within an interval, treating them as constant is an approximation. If the Markov assumption fails because the transition rates depend on unrecorded time spent in a state or on past history, a model based only on the current state may not describe the process adequately. State definitions, observation times, and any assumed constancy periods should therefore be justified in context.

Key takeaway: On each interval with constant intensity matrix \(Q_k\), calculate \(\exp(Q_kd_k)\). With row-origin transition matrices, multiply these matrices from earliest to latest, then check that the result is a valid probability matrix.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. What conditions must a finite-state intensity matrix satisfy?
  2. A constant intensity matrix applies for a duration of zero. What transition matrix should result?
  3. Two successive intervals have transition matrices \(P_1\) and \(P_2\). Under the row convention, which product gives the overall transition matrix?
  4. In the absorbing-state example, why is the probability of ending in state 1 not just the second-interval probability of moving from state 0 to state 1?
  5. What is one useful numerical check after calculating a transition matrix, and what can that check not establish?

Solutions. (1) Every off-diagonal intensity must be nonnegative, and each diagonal entry must be the negative sum of the other entries in its row, making the row sum zero. (2) \(\exp(Q\cdot 0)=I\), because the matrix exponential of the zero matrix is the identity. (3) Use \(P_1P_2\): multiply in chronological order for row-origin matrices. (4) State 1 is absorbing, so probability that entered it during the first interval remains in state 1; the overall probability includes that earlier contribution as well as exits during the second interval among those still in state 0. (5) Check that every row sums to 1 and entries are within the probability range, allowing for rounding. This checks a basic mathematical property but does not establish that the model assumptions are appropriate or that estimated intensities are precise.

Clinical Biostats