Skip to content

Direct vs. Recursive Prediction

EPF uses a direct prediction strategy for multi-step forecasting, where each forecast horizon group has its own dedicated model. This avoids the error propagation problem inherent in recursive approaches.

The Two Approaches

Recursive Prediction

A single model predicts one step ahead. To forecast further, its own predictions are fed back as inputs:

Step 1: model(features_t) → price_t+1
Step 2: model(features_t, price_t+1) → price_t+2
Step 3: model(features_t, price_t+1, price_t+2) → price_t+3
...

Problem: Errors compound. If the model overpredicts at step 1, that error propagates into step 2’s inputs, which propagates into step 3, and so on. By hour 168 (7 days ahead), accumulated errors can be substantial.

Direct Prediction

Separate models are trained for different horizon groups. Each model predicts its target hours directly from features available at the forecast origin:

Model_DA1: features_at_origin → prices for hours 14-25 ahead
Model_DA2: features_at_origin → prices for hours 26-37 ahead
Model_S1: features_at_origin → prices for hours 33-56 ahead
...

Advantage: No error propagation. An error in the D+1 forecast has zero impact on the D+3 forecast, because they come from independent models.

Why Direct Works for EPF

Feature Design

In the direct approach, all features are computed relative to the forecast origin (time t), not relative to the target hour. This means:

  • Price lags reference actual observed prices at the origin: price_lag_1h, price_lag_24h, price_lag_168h
  • Weather features include both observations at the origin and forecasts at the target hour
  • Target-hour features provide the model with temporal context: which hour, which day of week, how far ahead

Each model learns the relationship between current conditions and prices at a specific future distance, rather than trying to learn a single one-step-ahead relationship applied repeatedly.

Horizon Groups Balance Specialization and Data

Rather than training a separate model for every single hour (which would fragment the training data), horizons are grouped:

GroupHours AheadRationale
DA114–25D+1 morning hours
DA226–37D+1 afternoon/evening hours
S133–56D+2 (1-day ahead strategic)
S257–80D+3
S381–104D+4
S4105–128D+5
S5129–176D+6 and D+7 combined

Hours within the same group share a trained model. The hours_ahead feature allows the model to differentiate between individual hours within a group.

Tree Models Handle NaN Natively

A practical benefit of the direct approach with gradient boosting models: features that aren’t available for certain horizons (like D+1 published prices in the morning run) are simply set to NaN. Tree-based models handle missing values natively by learning optimal split directions for NaN values during training — no imputation required.

Trade-offs

AspectDirectRecursive
Error propagationNoneCompounds over horizons
Number of modelsMultiple (7 groups)Single
Training timeHigher (train N models)Lower (train 1 model)
Feature designRelative to originRelative to each step
Missing valuesClean NaN handlingRequires imputation

For EPF’s 7-day horizon, the elimination of error propagation decisively favors the direct approach. The additional training cost is manageable — 7 horizon groups × 3 model types = 21 models per product, each training in seconds on modern hardware.