Abstract: When forecasting time series with a hierarchical structure, the existing state of the art is to forecast each time series independently, and, in a post-treatment step, to reconcile the time series in a way that respects the hierarchy. We propose a new loss function that can be incorporated into any maximum likelihood objective with hierarchical data, resulting in reconciled estimates with confidence intervals that correctly account for additional uncertainty due to imperfect reconciliation. We evaluate our method using a non-linear model and synthetic data on a counterfactual forecasting problem, where we have access to the ground truth and contemporaneous covariates, and show that we largely improve over the existing state-of-the-art method.
Introduction
Many real-world datasets are naturally hierarchical. For example, in retail, individual product sales must sum to category totals, which in turn sum to total store sales. Traditional approaches, known as Optimal Reconciliation (HTS), typically follow a two-step process: forecasting every level of the hierarchy independently and then applying a mathematical reconciliation step to ensure the numbers add up.
However, this independent forecasting often discards valuable structural information. Furthermore, post-hoc reconciliation frequently fails to provide accurate confidence intervals because it does not account for the uncertainty introduced during the "fixing" step. This paper proposes a self-supervised approach that integrates reconciliation directly into the objective function during training.
Methods
The core innovation is a loss function that treats the hierarchy as a self-supervised signal. Instead of just minimizing error on historical data, the authors add a "reconciliation penalty" to the training objective.
The total loss consists of:
- Forecasting Loss: Standard error (like MSE) on the training data.
- Reconciliation Loss: A penalty applied to the forecast period (where labels are unknown) that punishes the model if the predicted child nodes do not sum to the predicted parent node.
This approach is "self-supervised" because the model uses the internal structure of the data to teach itself during the forecast period. To handle large hierarchies efficiently, the authors introduce a Randomized Block Coordinate Descent algorithm, allowing the model to update parameters for one time series at a time, making the training process significantly more scalable.
Key Results
The method was evaluated using synthetic data generated from Gaussian processes with non-linear transformations. The results demonstrate that incorporating the hierarchy as a regularizer significantly improves generalization.
As shown in the results table, the proposed method (full_hierarchy_lam_10) dramatically reduced the Mean Squared Error (MSE) for the top-level parent node ($y_1$) from 5.78 in the baseline to 1.61. While standard HTS successfully forced forecasts to reconcile (reducing reconciliation error to near zero), it provided minimal improvement to actual forecast accuracy. In contrast, the self-supervised approach improved accuracy across almost every node in the hierarchy. Interestingly, adding the reconciliation penalty increased training error but significantly decreased test error, confirming its role as an effective regularizer that prevents overfitting to noise in individual series.
Conclusion
By treating reconciliation as an inductive bias rather than a post-processing step, this approach allows information to flow between parent and child nodes during the learning process. This results in more accurate forecasts and more reliable confidence intervals. Future work includes testing this loss function on other architectures like LSTMs or Transformers and scaling to massive real-world hierarchies.
Summary updated