Learn R Programming

FoReco

Forecast Reconciliation is a a post-forecasting process aimed to improve the accuracy and align forecasts for a system of linearly constrained (e.g. hierarchical/grouped) time series. The FoReco package provides a comprehensive set of classical (bottom-up, top-down and middle-out), and modern (optimal and heuristic combination) forecast reconciliation procedures in different frameworks including cross-sectional, temporal, or cross-temporal settings.

The core functions for reconciliation categorized by framework are as follows:

ReconciliationCross-sectionalTemporalCross-Temporal
Classical reconciliation
Top-down: *td()cstd()tetd()cttd()
Bottom-up: *bu()csbu()tebu()ctbu()
Middle-out: *mo()csmo()temo()ctmo()
Regression‑based reconciliation
Least squares: *rec()csrec()terec()ctrec()
LCC: *lcc()cslcc()telcc()ctlcc()

Additionally, FoReco provides various functions for different aspects of forecast reconciliation, including aggregating time series, balancing hierarchies, computing projection and covariance matrices, and more.

Installation

You can install the stable version on R CRAN

install.packages("FoReco")

You can also install the development version from Github

# install.packages("devtools")
devtools::install_github("danigiro/FoReco")

Getting Started

To get started with using the FoReco package, refer to the documentation for detailed information on how to apply different forecast reconciliation procedures to your data.

Issues and Contributions

If you encounter any bugs or have suggestions for improvements, please feel free to report them on GitHub Issues page. Contributions are also welcome!

Copy Link

Version

Install

install.packages('FoReco')

Monthly Downloads

535

Version

1.0.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Daniele Girolimetto

Last Published

August 20th, 2024

Functions in FoReco (1.0.0)

ctmo

Cross-temporal middle-out reconciliation
ctprojmat

Projection matrix for optimal combination cross-temporal reconciliation
ctbu

Cross-temporal bottom-up reconciliation
csrec

Optimal combination cross-sectional reconciliation
recoinfo

Informations on the reconciliation process
ctlcc

Level conditional coherent reconciliation for cross-temporal hierarchies
res2matrix

One-step and multi-step residuals
itagdp

Italian Quarterly National Accounts
tcsrec

Heuristic cross-temporal reconciliation
df2aggmat

Cross-sectional aggregation matrix of a dataframe
cttools

Cross-temporal reconciliation tools
cttd

Cross-temporal top-down reconciliation
ctrec

Optimal combination cross-temporal reconciliation
teboot

Temporal joint block bootstrap
temo

Temporal middle-out reconciliation
tetd

Temporal top-down reconciliation
telcc

Level conditional coherent reconciliation for temporal hierarchies
iterec

Iterative cross-temporal reconciliation
shrink_estim

Shrinkage of the covariance matrix
tetools

Temporal reconciliation tools
lcmat

Linear combination (aggregation) matrix for a general linearly constrained multiple time series
terec

Optimal combination temporal reconciliation
teprojmat

Projection matrix for optimal combination temporal reconciliation
tebu

Temporal bottom-up reconciliation
tecov

Temporal covariance matrix approximation
vndata

Australian Tourism Demand dataset
unbalance_hierarchy

Aggregation matrix of a balanced hierarchy in (possibly) unbalanced form
balance_hierarchy

Aggregation matrix of a (possibly) unbalanced hierarchy in balanced form
FoReco-package

FoReco: Forecast Reconciliation
csbu

Cross-sectional bottom-up reconciliation
FoReco2matrix

Reconciled forecasts to matrix/vector
csmo

Cross-sectional middle-out reconciliation
cslcc

Level conditional coherent reconciliation for genuine hierarchical/grouped time series
cscov

Cross-sectional covariance matrix approximation
aggts

Non-overlapping temporal aggregation of a time series
csboot

Cross-sectional joint block bootstrap
commat

Commutation matrix
csprojmat

Projection matrix for optimal combination cross-sectional reconciliation
ctcov

Cross-temporal covariance matrix approximation
ctboot

Cross-temporal joint block bootstrap
cstd

Cross-sectional top-down reconciliation
cstools

Cross-sectional reconciliation tools