Learn R Programming

FoReco (version 0.2.4)

ctbu: Bottom-up cross-temporal forecast reconciliation

Description

Cross temporal reconciled forecasts for all series at any temporal aggregation level are computed by appropriate summation of the high-frequency bottom base forecasts b_i, i = 1,...,n_b, according to a bottom-up procedure like what is currently done in both the cross-sectional and temporal frameworks.

Usage

ctbu(Bmat, m, C)

Arguments

Bmat

(n_b h m) matrix of high-frequency bottom time series base forecasts (B^[1]). h is the forecast horizon for the lowest frequency (most temporally aggregated) time series.

m

Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation, m), or a subset of the p factors of m.

C

(n_a n_b) cross-sectional (contemporaneous) matrix mapping the bottom level series into the higher level ones.

Value

The function returns a (n h (k^ + m)) matrix of bottom-up cross-temporally reconciled forecasts, Y.

Details

Denoting by Y the (n h (k^ + m)) matrix containing the bottom-up cross temporal reconciled forecasts, it is: Y = [arraycc CB^[1]K_1' & CB^[1] B^[1] K_1' & B^[1] array], where C is the cross-sectional (contemporaneous) aggregation matrix, K_1 is the temporal aggregation matrix with h=1, and B^[1] is the matrix containing the high-frequency bottom time series base forecasts. This expression is equivalent to vec(Y') = S vec(Y') for h = 1, where S is the cross-temporal summing matrix for vec(Y'), and Y is the (n h (k^ + m)) matrix containing all the base forecasts at any temporal aggregation order.

References

Di Fonzo, T., and Girolimetto, D. (2021), Cross-temporal forecast reconciliation: Optimal combination method and heuristic alternatives, International Journal of Forecasting, in press.

See Also

Other reconciliation procedures: cstrec(), htsrec(), iterec(), lccrec(), octrec(), tcsrec(), tdrec(), thfrec()

Examples

Run this code
# NOT RUN {
data(FoReco_data)
# monthly base forecasts
id <- which(simplify2array(strsplit(colnames(FoReco_data$base),
                                    split = "_"))[1, ] == "k1")
hfbts <- FoReco_data$base[-c(1:3), id]
obj <- ctbu(Bmat = hfbts, m = 12, C = FoReco_data$C)
rownames(obj) <- rownames(FoReco_data$base)

# }

Run the code above in your browser using DataLab