One-Step vs Multi-Step Time Series Forecasting: A Practical Guide
Let’s start with a simple analogy. Imagine we’re making a road trip and, for every one mile we drive, we would stop, reassess, and drive the next mile based on the first. Do you agree with me that we would know much better about things like the road conditions, the weather, the gas level, and many other variables?
Now let’s imagine something different. We will map out the entire 500-mile journey in one go. In that case, you will probably also agree with me that it is more difficult to know about what will happen during the trip after we run 10 miles, 50, or 100 miles, right?
When we’re forecasting future events, like next week’s sales or tomorrow’s temperature, you face a similar choice.
- Should you predict one period ahead and repeat that process? That’s the one-step, or recursive, approach.
- Or should you jump straight to predicting the whole future period all at once? This is the multi-step, or direct, approach.
In this post, we’ll break down these two core strategies. You’ll see how they work, why their errors behave differently, and we’ll cap it off with a simple Python script using statsforecast to make the differences crystal clear.
Let’s dive in!
Understanding One-Step (Recursive) Forecasts
Think of the one-step forecast as a cautious walker. The model predicts the immediate next period, say t+1. Then, to predict t+2, it takes the prediction for t+1 and treats it as a known, actual value. This cycle repeats for the entire forecast horizon.
This is a recursive process — it feeds its own outputs back as inputs. It’s like using yesterday’s forecasted weather to predict today’s, and today’s predicted weather to forecast tomorrow’s.
It sounds simple, right? And it is!
You only need one model, which makes training really efficient. However, here’s the problem: errors accumulate quickly. If your prediction for t+1 is slightly off, that mistake is baked into the prediction for t+2, which then influences t+3, and so on.
The further out you look, the more your forecast tends to drift from reality. That’s why a long-range weather prediction is often less reliable than the one for tomorrow!
Understanding Multi-Step (Direct) Forecasts
The multi-step approach aims directly at the target. Instead of chaining predictions, this strategy trains a separate, independent model for each future time step.
If you want to forecast five days ahead, you’ll train one model for day 1, a second model for day 2, and so on, up to day 5. Crucially, the prediction for day 5 doesn’t use the prediction for day 4 as input. Each model only uses the historical actual data.
The main benefit here is that the predictions are independent, meaning error accumulation is significantly reduced. A mistake at t+1 doesn’t necessarily spoil the prediction for t+5.
The downside?
You’ve got a lot more work to do! You need to train and maintain multiple models, or you need a more sophisticated, complex architecture (like a modern sequence-to-sequence Deep Learning model or the Temporal Fusion Transformer).
Quick Example: Comparing the Two with Code
Let’s look at how this plays out in practice. We’ll use Python and the high-performance statsforecast library by Nixtla to demonstrate the recursive nature of classic models.
In this example, we are working with the progression of the number of followers of my blog at Medium.
We will use the following models from StatsForecast:
- ETS (Error, Trend, Seasonality): This model is also known as Exponential Smoothing, and it is a good fit for univariate time series with clear, stable trend and/or seasonality.
- ARIMA (AutoRegressive Integrated Moving Average): Good models when your time series data exhibits autocorrelation and the series is non-stationary.
- Direct Approach with a Ridge Regression: trains a separate, independent model for each future time step.
The first two use a recursive approach, incorporating the predicted steps into the data and recalculating the next one, while the last one takes the direct approach to show the error accumulation contrast.
1. Load Modules and Data
Enough talk, now let’s code. First, we will import the modules needed.
!pip install statsforecast skforecast --quiet
# One-Step vs Multi-Step Forecast Comparison Script
import pandas as pd
from sklearn.metrics import mean_absolute_percentage_error
from statsforecast import StatsForecast
from statsforecast.models import AutoARIMA, AutoETS, ARIMA
from statsmodels.tsa.stattools import adfuller
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa.seasonal import STL
import matplotlib.pyplot as plt
!pip install statsforecast skforecast --quiet
# One-Step vs Multi-Step Forecast Comparison Script
import pandas as pd
from sklearn.metrics import mean_absolute_percentage_error
from statsforecast import StatsForecast
from statsforecast.models import AutoARIMA, AutoETS, ARIMA
from statsmodels.tsa.stattools import adfuller
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa.seasonal import STL
import matplotlib.pyplot as plt
Then, we can load the data (which you can find on GitHub) and format it according to StatsForecast requirements, which are the columns unique_id, ds, and y.
# Get period_end and followers numbers
df = pd.read_csv("/content/followers.csv",
usecols=[1, 5],
header=0,
names=['ds', 'y'],
parse_dates=['ds'])
# Add Unique ID for StatsForecast format
df['unique_id'] = 'followers'
# Sort
df.sort_values(by='ds', inplace=True)
df.reset_index(drop=True, inplace=True)
# Drop last row, as the month was not complete yet
df.drop(df.tail(1).index[0], axis=0, inplace=True)
# Get period_end and followers numbers
df = pd.read_csv("/content/followers.csv",
usecols=[1, 5],
header=0,
names=['ds', 'y'],
parse_dates=['ds'])
# Add Unique ID for StatsForecast format
df['unique_id'] = 'followers'
# Sort
df.sort_values(by='ds', inplace=True)
df.reset_index(drop=True, inplace=True)
# Drop last row, as the month was not complete yet
df.drop(df.tail(1).index[0], axis=0, inplace=True)
Here’s the first look at the data plot.
# 1. Plot the data
df.plot(x='ds', y='y',
figsize=(10, 5),
label='Followers',
title='Number of Followers 2020-2025');
# 1. Plot the data
df.plot(x='ds', y='y',
figsize=(10, 5),
label='Followers',
title='Number of Followers 2020-2025');
2. Check Data Stationarity
Next, we’ll check for stationarity. That’s easy enough to do with statsmodels.
# Check if data is stationary
# ADF Test
def adf_test(series):
result = adfuller(series, autolag='AIC')
print('ADF Statistic: %f' % result[0])
print('p-value: %f' % result[1])
print('Critical Values:')
for key, value in result[4].items():
print(' %s: %.3f' % (key, value))
print("ADF Test Results:n")
adf_test(df['y'])
ADF Test Results:
ADF Statistic: 2.476353
p-value: 0.999042
Critical Values:
1%: -3.541
5%: -2.909
10%: -2.592
# Check if data is stationary
# ADF Test
def adf_test(series):
result = adfuller(series, autolag='AIC')
print('ADF Statistic: %f' % result[0])
print('p-value: %f' % result[1])
print('Critical Values:')
for key, value in result[4].items():
print(' %s: %.3f' % (key, value))
print("ADF Test Results:n")
adf_test(df['y'])
ADF Test Results:
ADF Statistic: 2.476353
p-value: 0.999042
Critical Values:
1%: -3.541
5%: -2.909
10%: -2.592
We can see by the results that the data is not stationary. Just visually looking at it, we can identify a very clear uptrend. So, we can differentiate the data to get a stationary dataset.
p-value under the significance threshold of 5%, in favor of the alternative hypothesis of Stationarity of the data).
# Let's make the series stationary with one differencing.
adf_test(df['y'].diff().dropna())
ADF Statistic: -5.049668
p-value: 0.000018
Critical Values:
1%: -3.544
5%: -2.911
10%: -2.593
# Let's make the series stationary with one differencing.
adf_test(df['y'].diff().dropna())
ADF Statistic: -5.049668
p-value: 0.000018
Critical Values:
1%: -3.544
5%: -2.911
10%: -2.593
3. Looking at ACF and PACF
The next step isn looking at the ACF and PACF plots, as those can bring us many insights about the model to be used.
# 3. Let's examine the ACF and PACF plots
plot_acf(df['y'].diff().dropna(), lags=20)
plt.show()
plot_pacf(df['y'].diff().dropna(), lags=20)
plt.show()
# 3. Let's examine the ACF and PACF plots
plot_acf(df['y'].diff().dropna(), lags=20)
plt.show()
plot_pacf(df['y'].diff().dropna(), lags=20)
plt.show()
These are the ACF and PACF of the differenced data. Both graphics show a sinusoidal shape, and only the first lag is significant. This suggests that a model ARIMA(1,1,1)
Now, let’s check the Time Series decomposition with STL.
# Season Trend with Loess decomposition
stl = STL(df['y'], period=12)
res = stl.fit()
res.plot().show()
# Season Trend with Loess decomposition
stl = STL(df['y'], period=12)
res = stl.fit()
res.plot().show()
The results suggest a clear trend, but no clear seasonality. So, it is possible that the Exponential Smoothing works better than an ARIMA model. Let’s see.
4. Modeling
Let’s start by trying a short forecast for the next 6 months. We can split the data into train and test, leaving the last 6 periods as test.
# How many periods is the test set?
test_periods = 6
# Train test split
split = len(df) - test_periods
# Split train and test
train1 = df.iloc[:split]
test1 = df.iloc[split:]
# Models chosen
models = [AutoETS(),
ARIMA(order=(1,1,1)),
AutoARIMA(seasonal=False)]
# Instantiate
sf = StatsForecast(
models= models,
freq= 'ME'
)
# Fit
sf.fit(train1)
# Predict the next 6 months and 95% confidence interval
forecasts = sf.predict(h=6, level=[95])
# Plot series
sf.plot(df= test1,
forecasts_df=forecasts
)
# How many periods is the test set?
test_periods = 6
# Train test split
split = len(df) - test_periods
# Split train and test
train1 = df.iloc[:split]
test1 = df.iloc[split:]
# Models chosen
models = [AutoETS(),
ARIMA(order=(1,1,1)),
AutoARIMA(seasonal=False)]
# Instantiate
sf = StatsForecast(
models= models,
freq= 'ME'
)
# Fit
sf.fit(train1)
# Predict the next 6 months and 95% confidence interval
forecasts = sf.predict(h=6, level=[95])
# Plot series
sf.plot(df= test1,
forecasts_df=forecasts
)
The code will yield the following graphic, where we see that the models are doing just fine for the 6-month period, with the ARIMA model apparently being the best fit.
5. Evaluating
Now, let’s compare the models and see which performs best.
# Collecting Metrics
summaries = []
for model in sf.fitted_[0]:
summary_model = {
"model": model,
"loglik": model.model_['loglik'],
"AIC": model.model_['aic'],
"BIC": model.model_['bic']
}
summaries.append(summary_model)
# DataFrame
pd.DataFrame(summaries)
# MAPE
print(f"ETS: {mean_absolute_percentage_error(test2['y'], test2['AutoETS'])}")
print(f"ARIMA: {mean_absolute_percentage_error(test2['y'], test2['Arima'])}")
print(f"AutoARIMA: {mean_absolute_percentage_error(test2['y'], test2['AutoArima'])}")
# Collecting Metrics
summaries = []
for model in sf.fitted_[0]:
summary_model = {
"model": model,
"loglik": model.model_['loglik'],
"AIC": model.model_['aic'],
"BIC": model.model_['bic']
}
summaries.append(summary_model)
# DataFrame
pd.DataFrame(summaries)
# MAPE
print(f"ETS: {mean_absolute_percentage_error(test2['y'], test2['AutoETS'])}")
print(f"ARIMA: {mean_absolute_percentage_error(test2['y'], test2['Arima'])}")
print(f"AutoARIMA: {mean_absolute_percentage_error(test2['y'], test2['AutoArima'])}")
While the AIC and loglik indicate that the AutoARIMA model is the best fit, for this 6 months period shows a smaller MAPE for the ARIMA(1,1,1) model, confirming our visual examination.
Checking the residuals with L-Jung Box test, we see that the three models did well, staying over the significance level.
# Checking if residuals are independent
from statsmodels.stats.diagnostic import acorr_ljungbox
# Ljun-Box Q Test
# Ho - No residuals correlation. Good fit of the model.
# Ha - There is correlation/ pattern in the residuals. Not the best fit.
print('Residuals check: ETS')
print( acorr_ljungbox(
sf.fitted_[0][0].model_['residuals'],
lags=[6],
model_df=2) )
print('----------------------n')
print('Residuals check: ARIMA(1,1,1)')
print( acorr_ljungbox(
sf.fitted_[0][0].model_['residuals'],
lags=[6],
model_df=2) )
print('----------------------n')
print('Residuals check: AutoARIMA(0,2,1)')
print( acorr_ljungbox(
sf.fitted_[0][1].model_['residuals'],
lags=[6],
model_df=2) )
print('----------------------n')
Residuals check: ETS
lb_stat lb_pvalue
6 3.187315 0.526982
----------------------
Residuals check: ARIMA(1,1,1)
lb_stat lb_pvalue
6 3.187315 0.526982
----------------------
Residuals check: AutoARIMA(0,2,1)
lb_stat lb_pvalue
6 5.326436 0.255412
----------------------
# Checking if residuals are independent
from statsmodels.stats.diagnostic import acorr_ljungbox
# Ljun-Box Q Test
# Ho - No residuals correlation. Good fit of the model.
# Ha - There is correlation/ pattern in the residuals. Not the best fit.
print('Residuals check: ETS')
print( acorr_ljungbox(
sf.fitted_[0][0].model_['residuals'],
lags=[6],
model_df=2) )
print('----------------------n')
print('Residuals check: ARIMA(1,1,1)')
print( acorr_ljungbox(
sf.fitted_[0][0].model_['residuals'],
lags=[6],
model_df=2) )
print('----------------------n')
print('Residuals check: AutoARIMA(0,2,1)')
print( acorr_ljungbox(
sf.fitted_[0][1].model_['residuals'],
lags=[6],
model_df=2) )
print('----------------------n')
Residuals check: ETS
lb_stat lb_pvalue
6 3.187315 0.526982
----------------------
Residuals check: ARIMA(1,1,1)
lb_stat lb_pvalue
6 3.187315 0.526982
----------------------
Residuals check: AutoARIMA(0,2,1)
lb_stat lb_pvalue
6 5.326436 0.255412
----------------------
Direct Model
Let’s try the Multi-step Direct approach now. We will use the package skforecast to make that happen. Let’s import some modules.
from skforecast.direct import ForecasterDirect
from sklearn.linear_model import Ridge
from skforecast.direct import ForecasterDirect
from sklearn.linear_model import Ridge
Pull the data and format for the skforecast requirements.
# Get period_end and followers numbers
df2 = pd.read_csv("/content/followers.csv",
usecols=[1, 5],
header=0,
names=['ds', 'y'],
parse_dates=['ds'],
index_col='ds')
df2.sort_index(inplace=True)
# Drop last row, as the month was not complete yet
df.drop(df.tail(1).index[0], axis=0, inplace=True)
df2.index.freq = 'ME'
data = pd.Series(df2.y, index=df2.index)
data.head()
# Get period_end and followers numbers
df2 = pd.read_csv("/content/followers.csv",
usecols=[1, 5],
header=0,
names=['ds', 'y'],
parse_dates=['ds'],
index_col='ds')
df2.sort_index(inplace=True)
# Drop last row, as the month was not complete yet
df.drop(df.tail(1).index[0], axis=0, inplace=True)
df2.index.freq = 'ME'
data = pd.Series(df2.y, index=df2.index)
data.head()
Split train and test.
# How many periods is the test set?
test_periods = 6
# Train test split
split = len(df) - test_periods
# Split train and test
train = data.iloc[:split]
test = data.iloc[split:]
# How many periods is the test set?
test_periods = 6
# Train test split
split = len(df) - test_periods
# Split train and test
train = data.iloc[:split]
test = data.iloc[split:]
Fit the model and predict.
# Direct model
forecaster = ForecasterDirect(
regressor=Ridge(alpha=0.1),
lags=6,
steps=test_periods,
differentiation=2
)
forecaster.fit(y=train)
# Predict
predictions = forecaster.predict()
predictions.head()
# Direct model
forecaster = ForecasterDirect(
regressor=Ridge(alpha=0.1),
lags=6,
steps=test_periods,
differentiation=2
)
forecaster.fit(y=train)
# Predict
predictions = forecaster.predict()
predictions.head()
And finally, let’s compare all the models.
test2 = test1.reset_index(drop=True).copy()
test2['AutoArima'] = forecasts['AutoARIMA']
test2['Arima'] = forecasts['ARIMA']
test2['AutoETS'] = forecasts['AutoETS']
test2['direct'] = predictions.reset_index(drop=True)
test2.set_index('ds', inplace=True)
test2.head()
# Plot the comparison
test2.plot(figsize=(12,6));
test2 = test1.reset_index(drop=True).copy()
test2['AutoArima'] = forecasts['AutoARIMA']
test2['Arima'] = forecasts['ARIMA']
test2['AutoETS'] = forecasts['AutoETS']
test2['direct'] = predictions.reset_index(drop=True)
test2.set_index('ds', inplace=True)
test2.head()
# Plot the comparison
test2.plot(figsize=(12,6));
The output of this visualization clearly shows that the recursive forecasts (orange, green, and red lines) are better at modeling the followers (blue line).
Now, let’s check for larger periods of time, such as 24 months.
If we go back and change the train and test split and re-run the models for a 24-month forecast, here’s the result.
Now, the ARIMA models don’t do so well. Only ETS and the Direct are fitting the data.
ETS: 0.1275806874036789
ARIMA: 0.9656335711479187
AutoARIMA: 2.969238042831421
Direct: 0.12009286363917777
ETS: 0.1275806874036789
ARIMA: 0.9656335711479187
AutoARIMA: 2.969238042831421
Direct: 0.12009286363917777
When to Use Each Approach 🤔
So, which one should you use for your business problem?
The choice isn’t about which is “better” overall, but which is better for your specific need. It all comes down to the forecast horizon and your model type.
- Scenario: Short-term | Best Approach: frequent retrainingOne-step | Why? It’s efficient; you update the model often, so accumulated errors don’t matter much.
- Scenario:Long-term planning | Best Approach: Multi-step | Why? Avoids compounding the errors over a long horizon, giving you a more stable long-range view.
Real-Life Application: If you’re forecasting inventory for tomorrow’s delivery (short-term), one-step is great. But if you’re trying to determine the budget for next quarter’s staffing (long-term planning), you’ll want the error-mitigating power of a multi-step direct approach.
Before You Go
If you take only one thing away today, remember this: One-step forecasts walk forward carefully, while multi-step forecasts jump ahead boldly.
Both are valid, but they manage risk and error differently. Choosing the right one is the difference between a slightly incorrect daily sales prediction and a completely unusable quarterly budget projection.
If you liked this content, follow my blog for more.
Code Applied
Code Applied delivers practical, bite-sized tutorials on data science, AI agents, automation, and more. Each post packs…
Here’s the complete code in GitHub.
Time-Series/Multi-Step at main · gurezende/Time-Series
Experimenting with Time Series. Contribute to gurezende/Time-Series development by creating an account on GitHub.
References
StatsForecast ⚡️ — Nixtla
StatsForecast offers a collection of popular univariate time series forecasting models optimized for high performance…
4 Strategies for Multi-Step Time Series Forecasting — MachineLearningMastery.com
Time series forecasting is typically discussed where only a one-step prediction is required. What about when you need…
https://skforecast.org/0.7.0/user_guides/direct-multi-step-forecasting
The One Tool You Need to Master Time Series Forecasting
Mastering Time Series Forecasting with StatsForecast.
9 ARIMA models
Load common libraries and settings import warnings warnings.filterwarnings( “ignore”, ) import os…

![Rust programing for beginners [part three]](https://freedium-mirror.cfd/img/medium/4000/1*rbAHb6wM55zrH5vskkLvkg.jpeg)
