Tutorials › Exam ALTAM - Advanced Long-Term Actuarial Mathematics › Matrix Multiplication Order for Consecutive Intervals

Exam ALTAM · Transition Probabilities · Tutorial 53 of 999

Matrix Multiplication Order for Consecutive Intervals

Use the row-vector convention to combine interval transition matrices in chronological order and calculate probabilities across consecutive time periods.

Beginner 9 min read

What You'll Learn

  • Define transition matrices using row indices for starting states and column indices for ending states
  • Multiply consecutive-interval matrices in the correct chronological order
  • Derive the composition formula by conditioning on the intermediate state
  • Propagate an initial state distribution across two or more intervals
  • Recognize and correct the error of reversing matrix factors

Why Matrix Order Matters

A transition matrix records probabilities of moving from each starting state to each ending state. When a model has several consecutive time intervals, the probabilities across the full period are found by combining the matrices for those intervals. The order is important: a transition during the first interval must be applied before a transition during the second.

This tutorial uses the row-vector convention. Under this convention, each row of a transition matrix corresponds to the state at the start of an interval, and each column corresponds to the state at its end. State distributions are row vectors, so they are multiplied by transition matrices on the right. This convention makes the correct chronological order particularly direct.

Definition: For a process with states \(1,\ldots,m\), let \(P(s,t)\) be the transition matrix from time \(s\) to time \(t\), where \(s<t\). Its entry in row \(i\), column \(j\), is \(P_{ij}(s,t)=P(X_t=j\mid X_s=i)\). Each row sums to 1. If \(P(s,u)\) describes the first interval and \(P(u,t)\) the next, then the full transition matrix is \(P(s,t)=P(s,u)P(u,t)\).

The entries of a matrix product combine probabilities over possible intermediate states. Thus the order is not just a convention for writing down a calculation: it reflects the order in which the process moves through time. In general, the two products \(P(s,u)P(u,t)\) and \(P(u,t)P(s,u)\) are not equal.

The Composition Rule From Conditioning

Suppose the process is in state \(i\) at time \(s\), and we want the probability that it is in state \(k\) at time \(t\). At the intermediate time \(u\), it must be in some state \(j\). The events \(X_u=j\) partition the possibilities, so the law of total probability gives the full transition probability.

$$ P(X_t=k\mid X_s=i) =\sum_{j=1}^{m}P(X_u=j\mid X_s=i)P(X_t=k\mid X_u=j). $$

The first factor in each summand is the \((i,j)\) entry of \(P(s,u)\); the second is the \((j,k)\) entry of \(P(u,t)\). By the definition of matrix multiplication, the sum is exactly the \((i,k)\) entry of their product. This proves the composition rule. It relies on the Markov property: conditional on the state at time \(u\), the transition probabilities for the later interval do not require additional information about the earlier path.

$$ [P(s,u)P(u,t)]_{ik} =\sum_{j=1}^{m}P_{ij}(s,u)P_{jk}(u,t). $$

For a row-vector distribution \(\boldsymbol{\pi}(s)\), the distribution at time \(t\) is therefore \(\boldsymbol{\pi}(s)P(s,u)P(u,t)\). The leftmost matrix applies first to the distribution, and the next matrix applies to the resulting distribution. Matrix multiplication is associative, so for three intervals the products may be parenthesized either way, but their chronological factor order remains unchanged.

$$ \boldsymbol{\pi}(t) =\boldsymbol{\pi}(s)P(s,u)P(u,t). $$

Worked Applications

In each example, the matrices are hypothetical transition probabilities for a finite-state Markov process. The rows are starting states and the columns are ending states; all entries are probabilities for the interval named in the problem.

Worked Example: Two Intervals and a Reversed-Order Trap

A hypothetical benefit model has states 1, 2, and 3. Its first-interval matrix \(A\) and second-interval matrix \(B\) are \(A=\begin{pmatrix}0.7&0.3&0\\0.2&0.5&0.3\\0&0.4&0.6\end{pmatrix}\) and \(B=\begin{pmatrix}0.6&0.1&0.3\\0.1&0.7&0.2\\0.2&0.2&0.6\end{pmatrix}\). An individual starts in state 1. Find the distribution after both intervals and compare it with the result of reversing the factors.

Method. Because the process starts in state 1, its initial row distribution is \((1,0,0)\). First calculate \(AB\), placing the first-interval matrix on the left and the second-interval matrix on the right.

For row 1 of \(AB\), combine rows 1 and 2 of \(B\), weighted by row 1 of \(A\), \((0.7,0.3,0)\): \((0.7)(0.6,0.1,0.3)+(0.3)(0.1,0.7,0.2)=(0.45,0.28,0.27)\).

For row 2, use weights \((0.2,0.5,0.3)\): \((0.2)(0.6,0.1,0.3)+(0.5)(0.1,0.7,0.2)+(0.3)(0.2,0.2,0.6)=(0.23,0.43,0.34)\).

For row 3, use weights \((0,0.4,0.6)\): \((0.4)(0.1,0.7,0.2)+(0.6)(0.2,0.2,0.6)=(0.16,0.40,0.44)\). Thus \(AB=\begin{pmatrix}0.45&0.28&0.27\\0.23&0.43&0.34\\0.16&0.40&0.44\end{pmatrix}\).

The starting distribution selects row 1, so the final distribution is \((1,0,0)AB=(0.45,0.28,0.27)\). The probabilities sum to \(0.45+0.28+0.27=1\), as required.

Common mistake and correction. Reversing the factors gives \(BA=\begin{pmatrix}0.44&0.35&0.21\\0.21&0.46&0.33\\0.18&0.40&0.42\end{pmatrix}\), whose first row would incorrectly give \((0.44,0.35,0.21)\). This calculation describes applying \(B\) before \(A\), not the stated sequence. The correct chronological product is \(AB\).

Worked Example: Propagating a Mixed Starting Distribution

A hypothetical two-state process has first-interval matrix \(C=\begin{pmatrix}0.8&0.2\\0.3&0.7\end{pmatrix}\) and second-interval matrix \(D=\begin{pmatrix}0.5&0.5\\0.1&0.9\end{pmatrix}\). The initial distribution is \(\boldsymbol{\pi}_0=(0.7,0.3)\). Find the distribution after each interval and verify the final result using the combined matrix.

Method. Multiply the initial row distribution by \(C\). The probability of state 1 after the first interval is \((0.7)(0.8)+(0.3)(0.3)=0.56+0.09=0.65\). The probability of state 2 is \((0.7)(0.2)+(0.3)(0.7)=0.14+0.21=0.35\). Thus \(\boldsymbol{\pi}_1=(0.65,0.35)\), which sums to 1.

Now apply the second-interval matrix \(D\). The final probability of state 1 is \((0.65)(0.5)+(0.35)(0.1)=0.325+0.035=0.36\). The final probability of state 2 is \((0.65)(0.5)+(0.35)(0.9)=0.325+0.315=0.64\). Therefore, \(\boldsymbol{\pi}_2=(0.36,0.64)\).

To check, calculate the combined matrix: \(CD=\begin{pmatrix}0.8&0.2\\0.3&0.7\end{pmatrix} \begin{pmatrix}0.5&0.5\\0.1&0.9\end{pmatrix} =\begin{pmatrix}0.42&0.58\\0.22&0.78\end{pmatrix}\). Then \((0.7,0.3)CD=(0.7(0.42)+0.3(0.22),\,0.7(0.58)+0.3(0.78))=(0.36,0.64)\). This agrees with the interval-by-interval calculation. The check also confirms that both final probabilities sum to 1.

Common mistake avoided. The starting distribution is not a column vector under this convention. Using a column vector without changing the matrix convention leads to invalid multiplication or an unintended transpose.

Worked Example: Three Intervals and an Intermediate-State Event

A hypothetical process has two states. Its consecutive interval matrices are \(P_1=\begin{pmatrix}0.8&0.2\\0.3&0.7\end{pmatrix}\), \(P_2=\begin{pmatrix}0.6&0.4\\0.1&0.9\end{pmatrix}\), and \(P_3=\begin{pmatrix}0.5&0.5\\0.2&0.8\end{pmatrix}\). It starts in state 1. Find (a) the probability of being in state 1 after all three intervals and (b) the probability of being in state 1 at the end and state 2 after the first interval.

Method for (a). Multiply in chronological order. First, \(P_1P_2=\begin{pmatrix}0.50&0.50\\0.25&0.75\end{pmatrix}\). For example, its first-row, first-column entry is \((0.8)(0.6)+(0.2)(0.1)=0.50\); the other entries follow from the same row-by-column rule.

Next, \((P_1P_2)P_3= \begin{pmatrix}0.50&0.50\\0.25&0.75\end{pmatrix} \begin{pmatrix}0.5&0.5\\0.2&0.8\end{pmatrix} =\begin{pmatrix}0.35&0.65\\0.275&0.725\end{pmatrix}\). The probability of ending in state 1 from starting state 1 is the first-row, first-column entry, \(0.35\). The first row sums to \(0.35+0.65=1\), and the second to \(0.275+0.725=1\).

Method for (b). The event specifies state 2 after the first interval, so first multiply the probability of reaching that intermediate state, \(P_{12}^{(1)}=0.2\), by the probability of ending in state 1 given state 2 at that time. For the remaining two intervals, \(P_2P_3=\begin{pmatrix}0.38&0.62\\0.23&0.77\end{pmatrix}\). The required remaining-period probability is its row-2, column-1 entry, \(0.23\). Hence the joint probability is \((0.2)(0.23)=0.046\).

A path-level check gives the same answer: from state 2 after interval 1, the two possible states after interval 2 contribute \((0.2)(0.1)(0.5)+(0.2)(0.9)(0.2)=0.010+0.036=0.046\). The calculation uses the first-interval probability only once; the remaining transition probability is conditional on already being in state 2.

Practical Checks and Common Traps

Before carrying out a matrix calculation, identify the time interval represented by each factor. If the intervals are \(s\) to \(u\), then \(u\) to \(t\), write \(P(s,u)P(u,t)\) before calculating. This simple annotation prevents an order error, especially when matrices have different names or are supplied in a table.

After multiplication, check that every row of the combined matrix sums to 1, subject to any rounding. For a specified starting state, the answer is the corresponding row. For an initial distribution, multiply that row vector on the left and check that the resulting probabilities also sum to 1. These checks can detect arithmetic errors, but they cannot by themselves detect a reversed product: both \(AB\) and \(BA\) may still be stochastic matrices. Chronological reasoning is essential.

The composition rule applies when the matrices describe consecutive intervals for the same state process and the Markov property holds at their joining time. It does not require the two interval matrices to be equal. The matrix for one interval must represent transitions over that interval, not an unrelated period or a matrix whose rows and columns use a different state ordering.

Key takeaway: With row distributions and row-start/column-end transition matrices, apply interval matrices from left to right in chronological order: first interval, then second interval, then later intervals. Do not reverse the product.

Check Your Understanding

For each problem, use the row-vector convention and keep the interval order explicit.

  1. For two states, the first- and second-interval matrices are \(A=\begin{pmatrix}0.9&0.1\\0.2&0.8\end{pmatrix}\) and \(B=\begin{pmatrix}0.7&0.3\\0.4&0.6\end{pmatrix}\). Starting in state 1, what is the probability of ending in state 2? (Answer: 0.33)
  2. Let \(C=\begin{pmatrix}0.75&0.25\\0.2&0.8\end{pmatrix}\), \(D=\begin{pmatrix}0.5&0.5\\0.1&0.9\end{pmatrix}\), and \(\boldsymbol{\pi}_0=(0.4,0.6)\). What is the final distribution after the first interval \(C\) and then \(D\)? (Answer: \((0.268,\,0.732)\))
  3. For \(X=\begin{pmatrix}0.6&0.4\\0.3&0.7\end{pmatrix}\) followed by \(Y=\begin{pmatrix}0.8&0.2\\0.5&0.5\end{pmatrix}\), find the probability of ending in state 1 when starting in state 2. (Answer: 0.59)
  4. A process starts in state 1 and has three consecutive matrices \(P=\begin{pmatrix}0.7&0.3\\0.2&0.8\end{pmatrix}\), \(Q=\begin{pmatrix}0.6&0.4\\0.1&0.9\end{pmatrix}\), and \(R=\begin{pmatrix}0.8&0.2\\0.3&0.7\end{pmatrix}\). What is the probability of ending in state 2? (Answer: 0.475)
  5. For \(U=\begin{pmatrix}0.8&0.2\\0.4&0.6\end{pmatrix}\) followed by \(V=\begin{pmatrix}0.5&0.5\\0.2&0.8\end{pmatrix}\), find the correct probability of ending in state 1 from state 2, and the value obtained if the factors are reversed. (Answer: correct \(UV\) value 0.32; reversed \(VU\) value 0.48)
Clinical Biostats