Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 15 — Forecasting Methods

So far, we have studied how time series behave and how they can be modeled using AR, MA, ARMA, and ARIMA models.

We now turn to one of the main practical goals of time series analysis:

Forecasting is important in economics, business, finance, and policy.

Examples include:

This chapter introduces the basic logic of forecasting.


Learning Objectives

By the end of this chapter, you should be able to:


15.1 What Is a Forecast?

A forecast is a prediction of a future value based on information available today.

Suppose we observe:

x1,x2,,xTx_1, x_2, \dots, x_T

A forecast of xT+1x_{T+1} is written as:

x^T+1\hat{x}_{T+1}

More generally, an hh-step-ahead forecast is:

x^T+h\hat{x}_{T+h}

15.2 Forecasting Is Conditional

Forecasting is always based on available information.

At time TT, we know:

x1,x2,,xTx_1, x_2, \dots, x_T

but we do not yet know:

xT+1,xT+2,x_{T+1}, x_{T+2}, \dots

A forecast is therefore conditional on the information set available at time TT.


15.3 Forecast vs Fitted Value

It is important to distinguish a forecast from a fitted value.

A fitted value is produced for an observation already in the sample.

A forecast is produced for an observation not yet observed.

ConceptMeaning
fitted valuemodel prediction for an observed data point
forecastmodel prediction for a future data point

This is why out-of-sample evaluation is essential.


15.4 In-Sample vs Out-of-Sample Forecasting

In-Sample Fit

In-sample fit refers to how well the model explains data already used for estimation.

For example, if we estimate a model using observations 1 to TT, then fitted values within this same range are in-sample.

Out-of-Sample Forecasting

Out-of-sample forecasting evaluates how well the model predicts observations not used in estimation.


15.5 Train-Test Split for Time Series

In cross-sectional data, observations are often randomly split into training and testing samples.

In time series, we do not randomly shuffle observations.

Instead, we preserve time order.

For example:


15.6 One-Step-Ahead Forecasts

A one-step-ahead forecast predicts the next observation.

At time TT, the one-step-ahead forecast is:

x^T+1\hat{x}_{T+1}

For an AR(1) model:

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

the one-step-ahead forecast is:

x^T+1=ϕxT\hat{x}_{T+1} = \phi x_T

because the best prediction of the future shock is zero:

E[wT+1]=0E[w_{T+1}] = 0

15.7 Multi-Step-Ahead Forecasts

A multi-step-ahead forecast predicts more than one period into the future.

For AR(1):

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

the two-step-ahead forecast is:

x^T+2=ϕx^T+1=ϕ2xT\hat{x}_{T+2} = \phi \hat{x}_{T+1} = \phi^2 x_T

More generally:

x^T+h=ϕhxT\hat{x}_{T+h} = \phi^h x_T

If the mean is not zero, forecasts return toward:

μ1ϕ\frac{\mu}{1-\phi}

15.8 Forecasting a Random Walk

For a random walk:

xt=xt1+wtx_t = x_{t-1} + w_t

the best forecast of tomorrow is today’s value:

x^T+1=xT\hat{x}_{T+1} = x_T

For any horizon hh:

x^T+h=xT\hat{x}_{T+h} = x_T

15.9 Forecasting a Random Walk with Drift

For a random walk with drift:

xt=δ+xt1+wtx_t = \delta + x_{t-1} + w_t

the hh-step-ahead forecast is:

x^T+h=xT+hδ\hat{x}_{T+h} = x_T + h\delta

15.10 Static vs Dynamic Forecasts

Forecasting software often distinguishes between static and dynamic forecasts.

Static Forecasts

A static forecast uses actual lagged values whenever they are available.

For example, in an AR(1):

x^t=ϕ^xt1\hat{x}_{t} = \hat{\phi}x_{t-1}

uses the actual value xt1x_{t-1}.

Dynamic Forecasts

A dynamic forecast uses previous forecasts as inputs when actual future values are unavailable.

For example:

x^t=ϕ^x^t1\hat{x}_{t} = \hat{\phi}\hat{x}_{t-1}

15.11 Why Dynamic Forecasts Become Harder

Dynamic forecasts become less reliable as the horizon increases.

Why?

Because forecast errors accumulate.

This is especially important for:


15.12 Forecast Errors

A forecast error is the difference between the actual value and the forecast:

eT+h=xT+hx^T+he_{T+h} = x_{T+h} - \hat{x}_{T+h}

A good forecast has small errors on average.

Forecast evaluation is the focus of the next chapter.


15.13 Forecast Intervals

A point forecast gives a single predicted value.

But forecasts are uncertain.

A forecast interval gives a range of plausible future values.

For example, instead of saying:

Inflation next year will be 3%.

we might say:

Inflation is forecast to be 3%, with a plausible range from 2% to 4%.


15.14 Simulating Forecasts from an AR(1)

import numpy as np
import matplotlib.pyplot as plt

np.random.seed(123)

n = 120
phi = 0.8
w = np.random.normal(size=n)

x = np.zeros(n)

for t in range(1, n):
    x[t] = phi*x[t-1] + w[t]

T = 100
h = 20

history = x[:T+1]

forecast = np.zeros(h)
forecast[0] = phi * history[-1]

for i in range(1, h):
    forecast[i] = phi * forecast[i-1]

forecast_index = np.arange(T+1, T+h+1)

plt.figure(figsize=(10,4))
plt.plot(np.arange(T+1), history, label="Observed")
plt.plot(forecast_index, forecast, linestyle="--", label="Forecast")
plt.axvline(T, linestyle=":", color="black")
plt.title("Dynamic Forecast from an AR(1) Model")
plt.xlabel("Time")
plt.ylabel("$x_t$")
plt.legend()

plt.savefig("figs/ch15/AR1_forecast.png", dpi=300, bbox_inches="tight")
plt.close()   # replace with plt.show()
AR1 Forecast

15.15 Forecasting Workflow

A practical forecasting workflow is:

  1. plot the data

  2. check stationarity

  3. choose candidate models

  4. estimate models

  5. generate forecasts

  6. compare forecasts with actual values

  7. evaluate forecast errors

  8. revise the model if needed


15.16 Gretl Example: Forecasting with ARIMA

We now outline a simple forecasting workflow in GRETL.


Step 1: Estimate a Model

Model → Time series → ARIMA

Choose:


[GRETL Screenshot Placeholder: ARIMA model specification]

Step 2: Generate Forecasts

After estimating the model, in the model window:

Analysis → Forecasts

or:

Model window → Forecasts

depending on your GRETL version.


[GRETL Screenshot Placeholder: Forecast dialog]

Step 3: Choose Forecast Range

Choose:


[GRETL Screenshot Placeholder: Forecast range and options]

Step 4: Inspect Forecast Output

GRETL typically provides:


[GRETL Screenshot Placeholder: Forecast graph]


15.17 Common Mistakes


15.18 Looking Ahead

This chapter introduced the basic logic of forecasting.

In the next chapter, we study how to evaluate forecast accuracy.

We will examine:

Key Takeaways

Concept Check

Basic

  1. What is a forecast?

  2. What does it mean for a forecast to be conditional?

  3. What is the difference between a fitted value and a forecast?


Intuition

  1. Why is forecasting fundamentally uncertain?

  2. Why might a model fit past data well but perform poorly in forecasting?

  3. Why is out-of-sample evaluation important?


Intermediate

  1. What is the difference between:

    • one-step-ahead forecasts

    • multi-step-ahead forecasts

  2. What is the difference between:

    • static forecasts

    • dynamic forecasts

  3. Why do forecast errors tend to increase as the horizon grows?


Model-Based Forecasting

  1. In an AR(1) model, why is the expected value of the future shock set to zero?

  2. Why do AR(1) forecasts converge toward the long-run mean?


Challenge

  1. Suppose a model produces very stable forecasts.


Interpretation & Practice

  1. A model fits historical data extremely well but performs poorly out-of-sample.

    • What might be the issue?

    • What does this suggest about model evaluation?

  2. A forecast for a stationary AR(1) process gradually flattens over time.

    • Why does this happen?

  3. A random walk forecast remains constant over time.

    • What does this imply about predictability?

  4. A forecast diverges rapidly as the horizon increases.

    • What might this indicate about the underlying model?

  5. Dynamic forecasts differ significantly from static forecasts.

    • Why might this happen?


Finance Interpretation

  1. A stock price follows a random walk.

    • Why is the best forecast of tomorrow’s price today’s price?

  2. A macroeconomic forecast becomes less precise over longer horizons.

    • Why is this expected?


Challenge

  1. A model produces very narrow forecast intervals.

    • Why might this be misleading?

    • What could be wrong with the model?


Numerical Practice

One-Step Forecast

  1. Suppose:

xt=0.8xt1+wtx_t = 0.8 x_{t-1} + w_t

and xT=10x_T = 10.


Multi-Step Forecast

  1. Using the same model:


Random Walk

  1. Suppose:

xt=xt1+wtx_t = x_{t-1} + w_t

and xT=50x_T = 50.


Random Walk with Drift

  1. Suppose:

xt=xt1+2+wtx_t = x_{t-1} + 2 + w_t

and xT=100x_T = 100.


Forecast Error

  1. Suppose:


Interpretation

  1. Suppose forecast errors are consistently positive.


Dynamic Forecasting

  1. Suppose a dynamic forecast is used.


Challenge

  1. Suppose two models produce:

  1. You are forecasting monthly sales.

You estimate an AR(1) model and generate forecasts for the next 12 months.