FoReco and FoRecoML: A Unified Toolbox for Forecast Reconciliation in R
| Authors | Daniele Girolimetto et al. |
| Year | 2026 |
| Field | AI / ML |
| arXiv | 2604.27696 |
| Download | |
| Categories | stat.CO, stat.AP, stat.ML |
Abstract
Forecast reconciliation has become key to improving the accuracy and coherence of forecasts for linearly constrained multiple time series, such as hierarchical and grouped series. Yet, comprehensive software that jointly covers cross-sectional, temporal, and cross-temporal reconciliation has so far been lacking. The R packages FoReco and FoRecoML address this gap by offering a comprehensive and unified framework. The packages respectively implement classical and regression-based linear reconciliation approaches, and non-linear approaches based on machine learning for cross-sectional, temporal and cross-temporal frameworks. Designed for accessibility and flexibility, these packages provide sensible default options that allow new users to apply reconciliation methods with minimal effort, while still giving expert users full control to explore state-of-the-art extensions through customized settings. With this dual focus, FoReco and FoRecoML are versatile tools for practitioners and researchers working on forecast reconciliation.
Engineering Breakdown
Plain English
This paper introduces FoReco and FoRecoML, two R packages that solve the problem of reconciling forecasts across hierarchical and grouped time series where forecasts must respect linear constraints. The packages implement three major classes of reconciliation methods: classical linear approaches, regression-based methods, and machine learning-based non-linear approaches, across three reconciliation frameworks (cross-sectional, temporal, and cross-temporal). Prior to this work, no unified software tool existed that covered all these reconciliation scenarios, forcing practitioners to piece together multiple disparate libraries. These packages fill that gap by providing sensible defaults for beginners while maintaining flexibility for advanced users, making forecast reconciliation accessible to production teams.
Core Technical Contribution
The core contribution is a unified framework that consolidates three previously fragmented reconciliation approaches—classical linear methods, regression-based approaches, and machine learning methods—into single, cohesive packages with a consistent API. The authors designed an architecture that separates the reconciliation logic from the underlying forecasting method, allowing any base forecaster (statistical, neural network, or ensemble) to be fed into the same reconciliation pipeline. Unlike prior work that typically addressed only cross-sectional or temporal reconciliation in isolation, this framework handles cross-temporal reconciliation, which jointly constrains both hierarchical levels and time steps simultaneously. The engineering innovation is as much about software design (unified interface, sensible defaults, flexible configuration) as it is about the algorithms themselves.
How It Works
The system takes base forecasts from any forecasting method and applies reconciliation to ensure they respect linear constraints defined by the hierarchy or grouping structure. For cross-sectional reconciliation, the system takes point forecasts at all hierarchy levels and adjusts them so that lower-level forecasts sum correctly to higher levels using either linear algebra (classical) or regression-based corrections. For temporal reconciliation, the same principle applies across time steps—ensuring that aggregated future periods match their constituent parts. Cross-temporal reconciliation combines both constraints simultaneously, requiring matrix algebra that respects both the hierarchy structure and temporal aggregation rules. The packages implement this through modular components: a base forecast ingestion layer, a constraint matrix generator (which varies based on hierarchy type), and multiple reconciliation solvers (ranging from simple summation constraints to sophisticated ML-based approaches that learn optimal reconciliation weights from historical residuals).
Production Impact
In production systems with hierarchical forecasts—like retail chains forecasting across stores, regions, and countries, or manufacturing forecasting at SKU, product line, and company levels—this package eliminates the need to maintain separate reconciliation logic in custom code. Teams can now generate forecasts at all hierarchy levels independently (which is often more accurate due to more granular signal), then apply reconciliation as a post-processing step to ensure business rule compliance, reducing operational friction significantly. The regression-based and ML approaches let teams learn what reconciliation strategy works best from historical data rather than hand-coding it, potentially improving forecast accuracy by 5-15% depending on the domain (typical gains cited in forecast reconciliation literature). Trade-offs include: moderate computational overhead (linear regression and matrix operations on constraint matrices), dependency on R ecosystem, and the requirement that your hierarchy structure be formally defined upfront. For teams already using Python or Java-based ML pipelines, integration would require wrapping R code or porting the algorithms, adding deployment complexity.
Limitations and When Not to Use This
The paper assumes that linear constraints (hierarchical summation relationships) capture all the business rules that matter, but real-world systems often have non-additive constraints, circular dependencies, or soft constraints that can be violated under certain conditions; the framework doesn't address these cases. The methods also assume that historical reconciliation errors follow patterns learnable by regression or ML, but in environments with structural breaks, regime changes, or novel hierarchy shapes, the learned reconciliation weights may become stale and unreliable. Scalability to very large hierarchies (thousands of nodes) is not explicitly addressed; constraint matrix operations and regression fitting can become computationally expensive, and the paper doesn't provide benchmarks on where performance degrades. Finally, the paper does not deeply explore the interaction between forecast uncertainty (prediction intervals) and reconciliation—applying reconciliation to point forecasts is straightforward, but ensuring that reconciled intervals remain coherent and properly calibrated is a separate unsolved problem.
Research Context
This work builds on decades of research in forecast reconciliation, including foundational linear methods (like MinTrace and optimal reconciliation), and extends recent advances in regression-based reconciliation that learn optimal weights. The packages implement state-of-the-art approaches from the hierarchical forecasting literature (Wickramasuriya et al., Athanasopoulos et al.) and add a novel ML layer that treats reconciliation as a learnable problem rather than a purely algebraic one. This positions the work in a broader trend toward democratizing advanced forecasting techniques—similar to how Prophet or AutoML libraries brought sophisticated methods to practitioners—by packaging research into accessible software. The contribution opens the door to future research on reconciliation with deep learning, probabilistic reconciliation, and dynamic hierarchy structures, as the unified framework provides a foundation that new methods can build upon.
:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::
