Tutorials › Linear Algebra › Multi-Step Forecasts from a Linear State Model

Applications in Networks, Economics and Data · Tutorial 960 of 1000

Multi-Step Forecasts from a Linear State Model

Use repeated matrix multiplication to forecast several steps ahead, check the computations, and interpret differences between predicted and observed states.

Intermediate 10 min read

What You'll Learn

  • Set up a finite-horizon forecast from a fixed linear state recurrence.
  • Compute successive predicted states by multiplying the transition matrix by a column vector.
  • Relate a forecast made from a later starting time to matrix powers.
  • Organize predicted states and observations in a time-indexed table.
  • Calculate and interpret observed-minus-predicted discrepancies.
  • Spot an incorrect matrix-power calculation and replace it with the correct one.

From a One-Step Rule to a Forecast Horizon

A discrete-time state model describes how a state changes from one time step to the next. A one-step rule may be enough to describe the model, but a forecast usually asks for the state several steps ahead. The calculation is repeated matrix multiplication: each predicted state becomes the input for the next update. Keeping the steps and time indices organized makes it easier to check the arithmetic and to compare predictions with later observations.

Assume throughout that the state is a column vector in \(\mathbb{R}^n\), and that the same real \(n\times n\) matrix \(\mathbf{A}\) is used at every step. The model has no additional input term. Given an initial state \(\mathbf{x}_0\), its recurrence is \(\mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k\) for each integer \(k\geq 0\). A finite-horizon forecast is the sequence of states calculated from this rule for a specified, finite number of future steps. It is a model-based prediction, not a guarantee that future observations will match it.

Definition: For an initial state \(\mathbf{x}_0\), the model-based forecast at time \(k\) is the vector \(\widehat{\mathbf{x}}_k\) obtained by setting \(\widehat{\mathbf{x}}_0=\mathbf{x}_0\) and repeatedly applying \(\widehat{\mathbf{x}}_{k+1}=\mathbf{A}\widehat{\mathbf{x}}_k\). The integer \(k\geq 0\) is the forecast horizon measured in steps from time \(0\). The matrix power \(\mathbf{A}^0\) means \(\mathbf{I}_n\); for \(k\geq 1\), \(\mathbf{A}^k\) is the product of \(k\) copies of \(\mathbf{A}\).

At each step the order of multiplication is determined by the model: the matrix acts on the state column from the left. A forecast table should keep the time index beside each vector. If observed states are available, write them separately as \(\mathbf{y}_k\). The difference \(\mathbf{y}_k-\widehat{\mathbf{x}}_k\) then records how far the observation is from the prediction in each coordinate. This comparison does not by itself explain why a difference occurred.

Computing Successive States

Worked Example: Three Forecast Steps

Let \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) and \(\mathbf{x}_0=\begin{bmatrix}2\\1\end{bmatrix}\). Compute the forecast through time \(3\).

Apply the update rule to the initial state:

$$ \widehat{\mathbf{x}}_1 =\mathbf{A}\mathbf{x}_0 =\begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}2\\1\end{bmatrix} =\begin{bmatrix}1(2)+1(1)\\0(2)+1(1)\end{bmatrix} =\begin{bmatrix}3\\1\end{bmatrix}. $$

Use this predicted state as the input for the next step, then repeat once more:

$$ \widehat{\mathbf{x}}_2 =\mathbf{A}\widehat{\mathbf{x}}_1 =\begin{bmatrix}1(3)+1(1)\\0(3)+1(1)\end{bmatrix} =\begin{bmatrix}4\\1\end{bmatrix}, \qquad \widehat{\mathbf{x}}_3 =\mathbf{A}\widehat{\mathbf{x}}_2 =\begin{bmatrix}1(4)+1(1)\\0(4)+1(1)\end{bmatrix} =\begin{bmatrix}5\\1\end{bmatrix}. $$

The table records the initial state and all three predictions. Each row after time \(0\) is obtained by multiplying the previous row's state by \(\mathbf{A}\).

Time \(k\)Forecast state \(\widehat{\mathbf{x}}_k\)
0\(\begin{bmatrix}2\\1\end{bmatrix}\)
1\(\begin{bmatrix}3\\1\end{bmatrix}\)
2\(\begin{bmatrix}4\\1\end{bmatrix}\)
3\(\begin{bmatrix}5\\1\end{bmatrix}\)

Check: multiplying each forecast by \(\mathbf{A}\) gives the next one: \(\mathbf{A}\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}3\\1\end{bmatrix}\), \(\mathbf{A}\begin{bmatrix}3\\1\end{bmatrix}=\begin{bmatrix}4\\1\end{bmatrix}\), and \(\mathbf{A}\begin{bmatrix}4\\1\end{bmatrix}=\begin{bmatrix}5\\1\end{bmatrix}\). Thus every step satisfies the stated recurrence.

This calculation suggests a general formula: the state at time \(k\) is found by applying \(\mathbf{A}\) a total of \(k\) times to the initial state. The result follows directly from the recurrence, rather than from an assumption about a special kind of transition matrix.

Theorem (Finite-horizon forecast formula): Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\), and let \(\mathbf{x}_0\in\mathbb{R}^n\). The sequence defined by \(\mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k\) satisfies \(\mathbf{x}_k=\mathbf{A}^k\mathbf{x}_0\) for every integer \(k\geq 0\).

Proof. We use induction on \(k\). At \(k=0\), the formula gives \(\mathbf{A}^0\mathbf{x}_0=\mathbf{I}_n\mathbf{x}_0=\mathbf{x}_0\), as required. Now suppose that \(\mathbf{x}_k=\mathbf{A}^k\mathbf{x}_0\) for some \(k\geq 0\). The recurrence then gives \(\mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k=\mathbf{A}(\mathbf{A}^k\mathbf{x}_0)=(\mathbf{A}\mathbf{A}^k)\mathbf{x}_0=\mathbf{A}^{k+1}\mathbf{x}_0\), where the last equality is the definition of the next matrix power. This proves the formula at \(k+1\). By induction it holds for every \(k\geq 0\). \(\square\)

The formula can be used when a forecast is required at a particular horizon, while repeated one-step multiplication is often convenient for constructing a complete table. These are two ways to carry out the same model calculation. The recurrence also determines the forecast uniquely: once the starting state is fixed, each next state is specified as the product of \(\mathbf{A}\) and the current state.

Starting a Forecast at a Later Time

Forecasts need not always start at time \(0\). Suppose a state \(\mathbf{x}_s\) is available at some time \(s\), and we want to forecast \(h\) steps beyond it. The same transition matrix is applied \(h\) times. This makes it possible to create a fresh forecast from a later starting state without recomputing the earlier rows.

Proposition: If a sequence satisfies \(\mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k\), then for any integers \(s,h\geq 0\), \(\mathbf{x}_{s+h}=\mathbf{A}^h\mathbf{x}_s\).

Proof. Fix \(s\) and use induction on \(h\). When \(h=0\), \(\mathbf{A}^0\mathbf{x}_s=\mathbf{I}_n\mathbf{x}_s=\mathbf{x}_s\). Suppose \(\mathbf{x}_{s+h}=\mathbf{A}^h\mathbf{x}_s\). Applying the recurrence at time \(s+h\) gives \(\mathbf{x}_{s+h+1}=\mathbf{A}\mathbf{x}_{s+h}=\mathbf{A}\mathbf{A}^h\mathbf{x}_s=\mathbf{A}^{h+1}\mathbf{x}_s\). Therefore the formula holds for \(h+1\), and induction proves it for all \(h\geq 0\). \(\square\)

Worked Example: Using a Later Starting State

Let \(\mathbf{A}=\begin{bmatrix}1&1\\1&0\end{bmatrix}\) and \(\mathbf{x}_0=\begin{bmatrix}1\\0\end{bmatrix}\). Find the forecasts through time \(3\), and also calculate the time-\(3\) forecast from the time-\(1\) state.

First calculate the successive states:

$$ \widehat{\mathbf{x}}_1 =\begin{bmatrix}1&1\\1&0\end{bmatrix} \begin{bmatrix}1\\0\end{bmatrix} =\begin{bmatrix}1\\1\end{bmatrix}, \qquad \widehat{\mathbf{x}}_2 =\begin{bmatrix}1&1\\1&0\end{bmatrix} \begin{bmatrix}1\\1\end{bmatrix} =\begin{bmatrix}2\\1\end{bmatrix}, \qquad \widehat{\mathbf{x}}_3 =\begin{bmatrix}1&1\\1&0\end{bmatrix} \begin{bmatrix}2\\1\end{bmatrix} =\begin{bmatrix}3\\2\end{bmatrix}. $$

For a two-step forecast from time \(1\), compute \(\mathbf{A}^2\) and apply it to \(\widehat{\mathbf{x}}_1\):

$$ \mathbf{A}^2 =\begin{bmatrix}1&1\\1&0\end{bmatrix} \begin{bmatrix}1&1\\1&0\end{bmatrix} =\begin{bmatrix}1(1)+1(1)&1(1)+1(0)\\1(1)+0(1)&1(1)+0(0)\end{bmatrix} =\begin{bmatrix}2&1\\1&1\end{bmatrix}, $$ $$ \mathbf{A}^2\widehat{\mathbf{x}}_1 =\begin{bmatrix}2&1\\1&1\end{bmatrix} \begin{bmatrix}1\\1\end{bmatrix} =\begin{bmatrix}2(1)+1(1)\\1(1)+1(1)\end{bmatrix} =\begin{bmatrix}3\\2\end{bmatrix}. $$

Check: the direct two-step calculation from time \(1\) gives \(\mathbf{A}\widehat{\mathbf{x}}_1=\widehat{\mathbf{x}}_2=\begin{bmatrix}2\\1\end{bmatrix}\), followed by \(\mathbf{A}\widehat{\mathbf{x}}_2=\begin{bmatrix}3\\2\end{bmatrix}\). This agrees with \(\mathbf{A}^2\widehat{\mathbf{x}}_1\) and with the time-\(3\) forecast in the table.

Comparing Forecasts with Observations

Observed data can be placed beside predictions at matching times. In the example below, the initial state is used to generate a forecast, and observed states are supplied for comparison. Define the observed-minus-predicted difference at time \(k\) to be \(\mathbf{d}_k=\mathbf{y}_k-\widehat{\mathbf{x}}_k\). A positive or negative coordinate indicates the direction of the difference in that coordinate. A zero vector means the observation and prediction agree at that time.

Worked Example: Comparing a Forecast with Observed States

Let \(\mathbf{A}=\begin{bmatrix}\tfrac12&\tfrac14\\\tfrac14&\tfrac12\end{bmatrix}\) and \(\widehat{\mathbf{x}}_0=\begin{bmatrix}8\\4\end{bmatrix}\). Generate the forecast through time \(3\), then compare it with observations \(\mathbf{y}_0=\begin{bmatrix}8\\4\end{bmatrix}\), \(\mathbf{y}_1=\begin{bmatrix}5\\4\end{bmatrix}\), \(\mathbf{y}_2=\begin{bmatrix}4\\3\end{bmatrix}\), and \(\mathbf{y}_3=\begin{bmatrix}\tfrac52\\\tfrac94\end{bmatrix}\).

The first forecast step is

$$ \widehat{\mathbf{x}}_1 =\begin{bmatrix}\tfrac12&\tfrac14\\\tfrac14&\tfrac12\end{bmatrix} \begin{bmatrix}8\\4\end{bmatrix} =\begin{bmatrix}\tfrac12(8)+\tfrac14(4)\\\tfrac14(8)+\tfrac12(4)\end{bmatrix} =\begin{bmatrix}5\\4\end{bmatrix}. $$

Continue from that predicted state:

$$ \widehat{\mathbf{x}}_2 =\begin{bmatrix}\tfrac12(5)+\tfrac14(4)\\\tfrac14(5)+\tfrac12(4)\end{bmatrix} =\begin{bmatrix}\tfrac72\\\tfrac{13}{4}\end{bmatrix}, \qquad \widehat{\mathbf{x}}_3 =\begin{bmatrix}\tfrac12(\tfrac72)+\tfrac14(\tfrac{13}{4})\\ \tfrac14(\tfrac72)+\tfrac12(\tfrac{13}{4})\end{bmatrix} =\begin{bmatrix}\tfrac{41}{16}\\\tfrac52\end{bmatrix}. $$

Subtract the forecast from the corresponding observation in each row. For example, \(\mathbf{d}_2=\begin{bmatrix}4\\3\end{bmatrix}-\begin{bmatrix}\tfrac72\\\tfrac{13}{4}\end{bmatrix}=\begin{bmatrix}\tfrac12\\-\tfrac14\end{bmatrix}\), and \(\mathbf{d}_3=\begin{bmatrix}\tfrac52\\\tfrac94\end{bmatrix}-\begin{bmatrix}\tfrac{41}{16}\\\tfrac52\end{bmatrix}=\begin{bmatrix}-\tfrac1{16}\\-\tfrac14\end{bmatrix}\). The full comparison is:

Time \(k\)Forecast \(\widehat{\mathbf{x}}_k\)Observation \(\mathbf{y}_k\)Difference \(\mathbf{d}_k=\mathbf{y}_k-\widehat{\mathbf{x}}_k\)
0\(\begin{bmatrix}8\\4\end{bmatrix}\)\(\begin{bmatrix}8\\4\end{bmatrix}\)\(\begin{bmatrix}0\\0\end{bmatrix}\)
1\(\begin{bmatrix}5\\4\end{bmatrix}\)\(\begin{bmatrix}5\\4\end{bmatrix}\)\(\begin{bmatrix}0\\0\end{bmatrix}\)
2\(\begin{bmatrix}\tfrac72\\\tfrac{13}{4}\end{bmatrix}\)\(\begin{bmatrix}4\\3\end{bmatrix}\)\(\begin{bmatrix}\tfrac12\\-\tfrac14\end{bmatrix}\)
3\(\begin{bmatrix}\tfrac{41}{16}\\\tfrac52\end{bmatrix}\)\(\begin{bmatrix}\tfrac52\\\tfrac94\end{bmatrix}\)\(\begin{bmatrix}-\tfrac1{16}\\-\tfrac14\end{bmatrix}\)

Check: at time \(2\), adding the difference back to the forecast gives \(\begin{bmatrix}\tfrac72\\\tfrac{13}{4}\end{bmatrix}+\begin{bmatrix}\tfrac12\\-\tfrac14\end{bmatrix}=\begin{bmatrix}4\\3\end{bmatrix}=\mathbf{y}_2\). At time \(3\), the sum is \(\begin{bmatrix}\tfrac{41}{16}\\\tfrac{40}{16}\end{bmatrix}+\begin{bmatrix}-\tfrac1{16}\\-\tfrac4{16}\end{bmatrix}=\begin{bmatrix}\tfrac{40}{16}\\\tfrac{36}{16}\end{bmatrix}=\begin{bmatrix}\tfrac52\\\tfrac94\end{bmatrix}=\mathbf{y}_3\).

In this comparison the observations at times \(2\) and \(3\) do not equal the model's forecasts. The table reports that difference without changing the model or claiming a cause. If a new forecast is instead started from a later observed state, that is a new starting condition; the resulting forecast should be labelled accordingly.

Common Pitfall: Squaring Entries Instead of the Matrix

Matrix powers use matrix multiplication, not entry-by-entry powers. For the matrix \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\), a tempting but incorrect calculation is to square each entry and conclude \(\mathbf{A}^2=\begin{bmatrix}1&1\\0&1\end{bmatrix}\). That would predict \(\widehat{\mathbf{x}}_2=\begin{bmatrix}3\\1\end{bmatrix}\) from the first worked example, which merely repeats the time-\(1\) state.

The correction is to multiply the matrices in the definition of a power:

$$ \mathbf{A}^2 =\begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} =\begin{bmatrix}1&2\\0&1\end{bmatrix}, \qquad \mathbf{A}^2\begin{bmatrix}2\\1\end{bmatrix} =\begin{bmatrix}4\\1\end{bmatrix}. $$

This agrees with two successive updates: first \(\mathbf{A}\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}3\\1\end{bmatrix}\), then \(\mathbf{A}\begin{bmatrix}3\\1\end{bmatrix}=\begin{bmatrix}4\\1\end{bmatrix}\). A second frequent source of error is comparing vectors from different time indices. The forecast and observation must refer to the same time before their difference is interpreted.

Using a Forecast Table Well

A forecast table is useful because it makes both the calculation and the comparison explicit. For a fixed transition matrix and starting state, a reliable workflow is:

1
Record the model and starting state.
Write down the dimensions of \(\mathbf{A}\) and the column vector used as the initial state. This ensures that each matrix-vector product is defined.
2
Advance one step at a time.
Compute \(\widehat{\mathbf{x}}_{k+1}=\mathbf{A}\widehat{\mathbf{x}}_k\), showing the coordinates of the product and carrying exact fractions through the calculation.
3
Label each time and compare aligned data.
Put predictions and observations in the same row only when they refer to the same time. If a difference is requested, state its sign convention and calculate observation minus forecast consistently.

The recurrence defines the arithmetic of the forecast, but it does not establish that the model is appropriate for every application or horizon. In practice, the table lets a reader see exactly which predictions follow from the chosen starting state and transition matrix, and where observations begin to differ. Conclusions about whether those differences are important require context beyond the matrix multiplications themselves.

Check Your Understanding

Use exact arithmetic and check each computed state by applying the transition matrix to the preceding state.

  1. For \(\mathbf{A}=\begin{bmatrix}2&0\\0&1\end{bmatrix}\) and \(\mathbf{x}_0=\begin{bmatrix}1\\3\end{bmatrix}\), calculate the forecasts at times \(1\), \(2\), and \(3\).
  2. For a recurrence \(\mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k\), write the forecast at time \(s+4\) in terms of \(\mathbf{A}\) and \(\mathbf{x}_s\).
  3. If \(\widehat{\mathbf{x}}_2=\begin{bmatrix}3\\1\end{bmatrix}\) and \(\mathbf{y}_2=\begin{bmatrix}2\\4\end{bmatrix}\), calculate the observed-minus-predicted difference.
  4. Explain why a forecast and an observation must have matching time indices before they are subtracted.
  5. For \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\), calculate \(\mathbf{A}^2\) by matrix multiplication and use it to forecast from \(\mathbf{x}_0=\begin{bmatrix}0\\2\end{bmatrix}\) through time \(2\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon