Multi-Step Forecasts and Prediction Intervals

Author

John Robin Inston

Published

November 29, 2026

Code
import numpy as np
from statsmodels.tsa.arima.model import ARIMA
import plotly.graph_objects as go
from IPython.display import HTML, display

frappe = go.layout.Template(layout=go.Layout(
    paper_bgcolor="#303446",
    plot_bgcolor="#303446",
    font=dict(color="#c6d0f5"),
    colorway=["#8caaee", "#ef9f76"],
    xaxis=dict(gridcolor="#414559", zerolinecolor="#626880"),
    yaxis=dict(gridcolor="#414559", zerolinecolor="#626880"),
))


def show_plot(fig, load_plotly=False):
    fig.update_layout(
        template=frappe, height=340, autosize=True, hovermode="x unified",
        margin=dict(l=48, r=24, t=52, b=48),
        legend=dict(orientation="h", x=0, y=1.02, yanchor="bottom"),
    )
    display(HTML(fig.to_html(
        full_html=False,
        include_plotlyjs="cdn" if load_plotly else False,
        default_width="92%", config=dict(responsive=True),
    )))

1 Introduction

Decision-makers often need a range for future demand or production several periods ahead. A multi-step forecast estimates values beyond the next observation, and a prediction interval shows how uncertain those values are. This note uses an autoregression to explain how future shocks contribute to that uncertainty.

2 Definition and Properties

At origin \(t\), an \(h\)-step-ahead forecast predicts the future observation \(Y_{t+h}\) using the information \(\mathcal F_t\) available through time \(t\). A point forecast under squared-error loss is the conditional mean \(\mathbb E[Y_{t+h}\mid\mathcal F_t]\). A prediction interval at nominal level \(1-\alpha\) is an interval for that future observation with conditional probability \(1-\alpha\) under the model.

At one step ahead, a new shock can move the outcome away from the forecast. At two steps ahead, the outcome can also inherit part of the previous shock. In a stationary AR(1), older shocks lose influence, so forecast uncertainty grows toward a limit. In a random walk, shocks persist, so uncertainty keeps growing.

2.1 Forecast error in an AR(1)

Consider \(Y_t=\phi Y_{t-1}+Z_t\) with \(|\phi|<1\) and independent normal innovations of mean zero and variance \(\sigma^2\). Repeated substitution gives the conditional mean and forecast error variance

\[ \hat Y_{t+h\mid t}=\phi^hY_t,\qquad s_h^2=\sigma^2\sum_{j=0}^{h-1}\phi^{2j}. \]

The error variance approaches the stationary variance \(\sigma^2/(1-\phi^2)\). With known parameters, a pointwise 95% Gaussian prediction interval is \(\hat Y_{t+h\mid t}\pm 1.96s_h\), where \(1.96\) is the approximate 97.5th percentile of the standard normal distribution. The corresponding random walk, with \(\phi=1\), has error variance \(h\sigma^2\).

2.2 Coverage in practice

Common fitted-model intervals treat the estimated parameters as fixed. Model misspecification and estimation uncertainty can affect actual coverage. Pointwise 95% intervals target 95% coverage for each horizon separately. Coverage of an entire future path requires a simultaneous interval or another joint prediction region.

Use rolling origins to check empirical coverage at each horizon. Count the fraction of held-out observations that fall inside their intervals, and report interval widths alongside coverage.

3 Python Application

Fit an AR(1) to 250 simulated observations. Forecast the next 12 and compare them with the held-out values. The shaded band shows the pointwise 95% intervals conditional on the fitted parameters.

Code
rng = np.random.default_rng(42)
phi = 0.85
series = np.empty(262)
series[0] = rng.normal(scale=1 / np.sqrt(1 - phi**2))
for t in range(1, len(series)):
    series[t] = phi * series[t - 1] + rng.normal()

split = 250
fit = ARIMA(series[:split], order=(1, 0, 0), trend="n").fit()
forecast = fit.get_forecast(steps=len(series) - split)
lower, upper = forecast.conf_int(alpha=0.05).T
future = np.arange(split, len(series))

fig = go.Figure()
fig.add_scatter(x=future, y=lower, mode="lines", line=dict(width=0),
                showlegend=False, hoverinfo="skip")
fig.add_scatter(x=future, y=upper, mode="lines", line=dict(width=0),
                fill="tonexty", fillcolor="rgba(140,170,238,0.25)",
                name="95% prediction interval")
fig.add_scatter(x=np.arange(split - 30, split), y=series[split - 30:split],
                mode="lines", name="Training observations")
fig.add_scatter(x=future, y=series[split:], mode="markers",
                name="Held-out observations", marker=dict(color="#a6d189"))
fig.add_scatter(x=future, y=forecast.predicted_mean, mode="lines",
                name="Forecast", line=dict(dash="dash", color="#ef9f76"))
fig.update_layout(xaxis_title="Time step", yaxis_title="Value")
show_plot(fig, load_plotly=True)

The band widens as future innovations accumulate. This chart shows one realized path. Assess empirical coverage across many forecast origins.

4 References

Back to top