Skip to content

Releases: danigiro/FoReco

FoReco 1.3.1

Choose a tag to compare

@danigiro danigiro released this 13 Jul 07:24
  • User-facing functions now validate their arguments more strictly and fail with informative error messages that state the expected value and report the one actually supplied, replacing the previous generic diagnostics.
  • Replaced any(is.na()) with anyNA().
  • Internal helpers, S3 methods underlying the generics (e.g. the cscov(), tecov() and ctcov() methods) and the soft-deprecated res2matrix() are no longer listed in help(package = "FoReco"), so the help index now exposes only the user-facing functions.
  • Fixed the single-column name produced by as.data.frame() on a foreco object, which now uses the name of the object supplied by the user.

FoReco 1.3.0

Choose a tag to compare

@danigiro danigiro released this 22 Jun 08:52

Breaking changes

  • FoReco2matrix() is no longer exported. Use the new components() method on foreco objects (see New features below), which provides the same splitting of reconciled forecasts by temporal aggregation order.
  • recoinfo() has been removed. The same information is now available via summary() on a foreco object.
  • res2matrix() is soft-deprecated via lifecycle::deprecate_warn() and will be removed in a future release. Use as_hstack_telayout() or as_hstack_ctlayout() instead.

New features

  • New S3 class foreco for reconciled forecasts, returned by every reconciliation function (csrec(), terec(), ctrec(), csbu(), tebu(), ctbu(), cstd(), tetd(), cttd(), csmo(), temo(), ctmo(), cslcc(), telcc(), ctlcc(), csmvn(), temvn(), ctmvn(), cssmp(), tesmp(), ctsmp(), tcsrec(), cstrec(), iterec()). The class extends the underlying matrix or distributional object with a "FoReco" attribute that stores framework, function used, forecast type ("point" or "probabilistic") and reconciliation-specific metadata, and provides dedicated print(), summary(), plot(), components() methods.
  • Exported low-level constructor new_foreco_class() so that companion packages can produce objects that integrate with FoReco's print(), summary(), plot() and components() methods.
  • Implemented the generics::components() method for foreco objects, with cs, te, keep_names and temporal_names arguments to filter series and temporal aggregation orders.

Bug fixes and documentation

  • Fixed a bug in csrec() that occurred when the constraint matrix was not in the form derived by the aggregation matrix.
  • Added examples block to every exported function that was previously missing one (e.g. teboot()).
  • Revised the title field of every file so that all man page titles consistently follow title case.
  • Replaced patterns of the form t(A) %*% B and A %*% t(B) throughout the internal routines with crossprod(A, B) and tcrossprod(A, B) respectively.

FoReco 1.2.1

Choose a tag to compare

@danigiro danigiro released this 21 Apr 16:07
  • Fixed bug ... for simulate() in csboot(), teboot() and ctboot() and added xreg param in csboot(), teboot() and ctboot().

FoReco 1.2.0

Choose a tag to compare

@danigiro danigiro released this 13 Mar 13:43
  • (CRAN Package Check Results) Fixed compatibility issues with osqp 1.0. The package is now fully compatible with any version.
  • Added csmvn(), temvn(), and ctmvn() for Gaussian probabilistic forecast reconciliation in the cross-sectional, temporal, and cross-temporal frameworks using the distributional package;
  • Added cssmp(), tesmp(), and ctsmp() for sample-based probabilistic forecast reconciliation in the cross-sectional, temporal, and cross-temporal frameworks using the distributional package;
  • Added as_ctmatrix() and as_horizon_stacked_ctmatrix() functions to convert between horizon-stacked (cross-temporal version) and cross-temporal layouts;
  • Added as_tevector() and as_horizon_stacked_tematrix() functions to convert between horizon-stacked (temporal version) and temporal layouts;
  • Added non-negative forecast reconciliation algorithms bpv (block principal pivoting algorithm), nfca (negative forecasts correction algorithm), nnic (iterative non-negative reconciliation with immutable constraints), and sntz (set-negative-to-zero with bottom-up and top-down alternatives) based on:
    • Girolimetto, D. (2025), Non-negative forecast reconciliation: Optimal methods and operational solutions. arXiv;
    • Kourentzes, N. and Athanasopoulos, G. (2021) Elucidate structure in intermittent demand series. European Journal of Operational Research, 288, 141-152. doi:10.1016/j.ejor.2020.05.046;
    • Wickramasuriya, S. L., Turlach, B. A., and Hyndman, R. J. (2020), "Optimal non-negative forecast reconciliation", Statistics and Computing, 30(5), 1167–1182. doi:10.1007/s11222-020-09930-0;
  • Added ... for simulate() additional arguments in csboot(), teboot() and ctboot();
  • Fixed bugs and improved stability.

FoReco 1.1.0

Choose a tag to compare

@danigiro danigiro released this 08 Jun 16:16

New Features

  • Added new bpv non-negative forecast reconciliation algorithm (experimental) based on the cross-sectional framework presented in Wickramasuriya et al. (2020) and, now, extended for the temporal and cross-temporal framework:
    • Wickramasuriya, S. L., Turlach, B. A., and Hyndman, R. J. (2020), "Optimal non-negative forecast reconciliation", Statistics and Computing, 30(5), 1167–1182. doi:10.1007/s11222-020-09930-0;
  • New oasd cross-sectional covariance matrix (experimental), implementing an oracle shrunk covariance estimation (Ando and Xiao, 2023):
    • Ando, S., and Xiao, M. (2023), "High-dimensional covariance matrix estimation: shrinkage toward a diagonal target", IMF Working Papers, 2023(257), A001;
  • Redesigned bounds parameter to enable bounded forecast reconciliation for csrec(), terec(), and ctrec() functions;
  • Introduced new set_bounds() function to define custom bounds for reconciliation.

Bug Fixes

  • Fixed bug when only a subset of agg_order factors was selected in iterec(), tcsrec(), and cstrec() functions.

FoReco 1.0.0

Choose a tag to compare

@danigiro danigiro released this 21 Aug 08:54

Note – The latest release of FoReco introduces significant changes to its function notation and adds several new features. This major update, FoReco 1.0, is not compatible with previous versions due to the substantial changes made to the package's core structure. The previous version is available on Github (docs).

Due to the significant changes in FoReco 1.0, users are advised to carefully review the updated documentation and examples before using the new version. The latest documentation and release notes are available on danigiro.github.io/FoReco/

  • Updated Function Notation: All functions related to cross-sectional, temporal, and cross-temporal frameworks now use the prefixes cs, te, and ct, respectively. For example, the optimal combination reconciliation functions are now csrec(), terec(), and ctrec().

  • Simplified Function Outputs: Reconciliation functions now return only matrices. Additional information can be accessed using attr(., "FoReco") or the recoinfo() function.

  • New Datasets: Two new datasets, itagdp (Italian Quarterly National Accounts) and vndata (Australian Tourism Demand), are included along with their respective aggregation or constraint matrices.

  • Classic Approach: The middle-out approach (csmo(), temo(), and ctmo()) has been implemented alongside the classic bottom-up (csbu(), tebu(), and ctbu()) and top-down (cstd(), tetd(), and cttd()) methods.

  • Level Conditional Coherent Reconciliation: Level conditional coherent reconciliation is now available for all constraints: cslcc() (cross-sectional), telcc() (temporal), and ctlcc() (cross-temporal).

  • Immutable reconciliation: The immutable() parameter has been added to the reconciliation functions (csrec(), terec(), and ctrec()) to prevent the base forecasts from being modified with both the structural (approach='strc') and the zero-constrained (approach='proj') approach.

  • Balanced and unbalanced hierarchy: added balance_hierarchy() and unbalance_hierarchy() for dealing with balanced and unbalanced hierarchies.

  • Projection Matrix Functions: Functions csprojmat(), teprojmat(), and ctprojmat() have been added to obtain projection matrices.

  • Covariance Matrix Functions: Functions cscov(), tecov(), and ctcov() have been added to obtain covariance matrices.

  • Function Renaming: Several functions have been renamed to improve consistency and clarity

    • Cmatrix() -> df2aggmat()
    • hts_tools() -> cstools()
    • thf_tools() -> tetools()
    • ctf_tools() -> cttools()
    • agg_ts() -> aggts()
    • residuals_matrix() -> res2matrix()
    • boot_cs() -> csboot()
    • boot_te() -> teboot()
    • boot_ct() -> ctboot()
    • htsrec() -> csrec()
    • thfrec() -> terec()
    • octrec() -> ctrec()
    • lccrec() -> cslcc()

FoReco 0.2.6

Choose a tag to compare

@danigiro danigiro released this 17 May 07:14
Major changes: probabilistic forecast reconciliation
  • Added boot_cs(), boot_te() and boot_ct() to draw samples from, respectively, cross-sectional, temporal and cross-temporal joint (block) bootstrap.
Minor changes
  • Fixed deprecation warnings in Matrix (v. 1.5-0);
  • Improved docs and bug fixes;
  • Fixed ctbu() inputs;
  • Added FoReco2matrix() to trasform FoReco forecasts input and output in a list of matrix/vector class;
  • Added agg_ts(): non-overlapping temporal aggregation of a time series according to a specific aggregation order.
  • Added arrange_hres() and residuals_matrix() functions to arrange residuals for the covariance matrix under Gaussianity;

FoReco 0.2.5

Choose a tag to compare

@danigiro danigiro released this 04 Jul 12:05
Minor changes
  • Fixed the not negative reconciliation "sntz" for octrec();
  • Fixed documentation.

FoReco 0.2.4

Choose a tag to compare

@danigiro danigiro released this 16 Jun 12:08
Major changes
  • Added lcmat() function.
Minor changes
  • Fixed BU approach when the number of columns of basef is equal to the number of bottom time series htsrec();
  • Fixed score_index();
  • Fixed the bounds param when type = "S" in htsrec(), thfrec() and octrec();
  • Add the possibility to fix base forecasts through the v param in htsrec(), thfrec() and octrec() - experimental;
  • Add two new type of optimal cross-temporal reconciliation (cs_struc and t_struc);
  • Improved docs and bug fixes.

FoReco 0.2.1

Choose a tag to compare

@danigiro danigiro released this 24 Jul 08:44
Minor changes
  • Fixed a bug in the output of lccrec() (now the function returns the Level Conditional Coherent or the Combined Conditional Coherent forecasts);
  • Fixed the not negative reconciliation "KAnn" when keep = "list".