This function computes the cross-sectional bottom-up reconciled forecasts (Dunn et al., 1976) for all series by appropriate summation of the bottom base forecasts b: [REMOVE_ME]y=Scsb,[REMOVEME2]
where Scs is the cross-sectional structural matrix.
csbu(base, agg_mat, sntz =FALSE)
Arguments
base: A (h×nb) numeric matrix or multivariate time series (mts class) containing bottom base forecasts; h is the forecast horizon, and nb is the total number of bottom variables.
agg_mat: A (na×nb) numeric matrix representing the cross-sectional aggregation matrix. It maps the nb bottom-level (free) variables into the na upper (constrained) variables.
sntz: If TRUE, the negative base forecasts are set to zero before applying bottom-up.
Returns
A (h×n) numeric matrix of cross-sectional reconciled forecasts.
Description
This function computes the cross-sectional bottom-up reconciled forecasts (Dunn et al., 1976) for all series by appropriate summation of the bottom base forecasts b:
y=Scsb,
where Scs is the cross-sectional structural matrix.
Examples
set.seed(123)# (3 x 2) bottom base forecasts matrix (simulated), Z = X + Ybts <- matrix(rnorm(6, mean = c(10,10)),3, byrow =TRUE)# Aggregation matrix for Z = X + YA <- t(c(1,1))reco <- csbu(base = bts, agg_mat = A)# Non negative reconciliationbts[2,2]<--bts[2,2]# Making negative one of the base forecasts for variable Ynnreco <- csbu(base = bts, agg_mat = A, sntz =TRUE)
References
Dunn, D. M., Williams, W. H. and Dechaine, T. L. (1976), Aggregate versus subaggregate models in local area forecasting, Journal of the American Statistical Association