Skip to content
AI360XpertBeta

Multi-Step Forecasting

One-step models answer tomorrow, while multi-step plans answer the next seven days, and the way you stretch the model decides where errors grow.

Recursive feeds its own error forward while direct and multi-output predict the horizon without feedback
Recursive feeds its own error forward while direct and multi-output predict the horizon without feedback

Why Does This Exist?

Nobody staffs a warehouse on tomorrow alone. Planners need the next seven days of demand, the grid needs the next 24 hours of load, and a single next-step model cannot answer either. Call the number of future steps the horizon hh, which means the count of values yt+1y_{t+1} through yt+hy_{t+h} you must emit.

Stretching a one-step model across a horizon is a design decision with real costs. Reuse one model and early mistakes become later inputs. Train one model per step and the steps stop agreeing with each other. Emit the whole vector at once and training gets harder as hh grows.

This page compares the three standard plans on one fixture so you can pick deliberately. For the recurrent model that often produces the vector, see LSTM for forecasting. When each step should carry its uncertainty, continue to probabilistic forecasting.

Think of It Like This

Directing a relay team versus cloning it

You must field runners for three legs. The recursive coach sends one runner, asks where they finished leg one, then starts leg two from that reported spot. A wrong report moves every later leg. The direct coach hires three separate runners who never meet, so each leg starts clean but the baton never actually passes. The joint coach trains one squad to run all three legs as a single rehearsed routine.

The reported spot is the fed-back forecast. The never-meeting runners are the hh separate models. The rehearsed routine is the multi-output vector. Pick the coach whose failure you can afford.

Where it stops: runners get tired and forecasts do not, while forecasts compound statistical error and runners do not. The analogy covers the error flow, not the training cost.

How It Actually Works

Fix a horizon of h=3h = 3 and a history of [10,12,15][10, 12, 15]. Assume the one-step rule adds 22 to the last value. All three plans start from the same history and the same rule, and they diverge only in how the three outputs relate.

Recursive trains one model for yt+1y_{t+1} and iterates. It predicts 1717, feeds 1717 back, predicts 1919, feeds that back, predicts 2121. One model, three calls, and a miss at step one shifts every step after it.

Direct trains three models, one per step, all reading the same history. Model one predicts 1717, model two predicts 1818, model three predicts 2121. No forecast becomes an input, so errors never compound, but the three answers can contradict each other because the models never coordinate.

Multi-output trains one model that emits the vector [17,19,21][17, 19, 21] in a single pass. The steps stay consistent because one set of weights produces all of them, at the price of fitting an hh-dimensional output.

Worked example

Take history [10.0,12.0,15.0][10.0, 12.0, 15.0] with step 2.02.0 and horizon 33. The recursive path is 15+2=1715 + 2 = 17, then 17+2=1917 + 2 = 19, then 19+2=2119 + 2 = 21. Now suppose the true first value turns out to be 1616 while the model said 1717. The recursive second step starts from 1717 instead of 1616, so the one-unit miss is baked into 1919 and carried into 2121. Direct avoids this entirely because its second model never sees the 1717. That single carried unit is the compounding the diagram traces.

Code

This recursive rollout replays the fixture with only the standard library:

def recursive(history: list[float], step: float, horizon: int) -> list[float]:    path = list(history)    for _ in range(horizon):        path.append(path[-1] + step)    return path[-horizon:]

print(recursive([10.0, 12.0, 15.0], 2.0, 3))  # -> [17.0, 19.0, 21.0]

The output matches the hand trace: 17.0, then 19.0, then 21.0. Pass a history ending in 16.0 instead and the whole vector shifts down by one, which is compounding made visible.

Watch Out For

Judging a 7-day plan by its first-day error

The symptom is a recursive model that looks best on day one and worst on day seven. One-step error rewards the plan that feeds its own outputs back, because step one never sees feedback yet. Score every step separately out to hh and compare the full curve. If step-one error picks the winner while step-seven error disagrees, trust the horizon average, not the first point.

Leaking the future into direct model features

The symptom is a direct model for step five that is suspiciously accurate. Its training row for yt+5y_{t+5} accidentally includes an aggregate, such as a weekly mean, computed over days past tt. Audit every feature timestamp so nothing in XtX_t comes after tt. If removing one rolling feature collapses the gap between steps, that feature was the leak.

The Quick Version

  • Multi-step forecasting emits yt+1y_{t+1} through yt+hy_{t+h}, where hh is the horizon the planner actually needs.
  • Recursive reuses one model and feeds each forecast back, so a one-unit miss at step one shifts every later step.
  • Direct trains one model per step with no feedback, so steps never compound but can contradict each other.
  • Multi-output emits the whole vector in one pass, keeping steps consistent at the cost of harder training.
  • A history of 10, 12, 15 with step 2 gives 17, 19, 21, and the recursive path carries any early miss forward.
  • Score the full horizon curve, and audit direct features so nothing past tt leaks into XtX_t.