| FoReco2matrix | R Documentation |
This function splits the temporal vectors and the cross-temporal matrices in a list according to the temporal aggregation order
FoReco2matrix(x, agg_order, keep_names = FALSE, temporal_names = NULL)
x |
An output from any reconciliation function implemented by FoReco. |
agg_order |
Highest available sampling frequency per seasonal cycle
(max. order of temporal aggregation, |
keep_names |
If |
temporal_names |
A character vector containing the names of the temporal aggregation levels. |
A list of matrices or vectors distinct by temporal aggregation order.
Utilities:
aggts(),
as_ctmatrix(),
as_tevector(),
balance_hierarchy(),
commat(),
csprojmat(),
cstools(),
ctprojmat(),
cttools(),
df2aggmat(),
lcmat(),
recoinfo(),
res2matrix(),
set_bounds(),
shrink_estim(),
shrink_oasd(),
teprojmat(),
tetools(),
unbalance_hierarchy()
set.seed(123)
# (3 x 7) base forecasts matrix (simulated), Z = X + Y and m = 4
base <- rbind(rnorm(7, rep(c(20, 10, 5), c(1, 2, 4))),
rnorm(7, rep(c(10, 5, 2.5), c(1, 2, 4))),
rnorm(7, rep(c(10, 5, 2.5), c(1, 2, 4))))
reco <- ctrec(base = base, agg_mat = t(c(1,1)), agg_order = 4, comb = "ols")
matrix_list <- FoReco2matrix(reco)
# With temporal names
temporal_names <- c("Annual", "Semi-annual", "Quarterly")
matrix_list <- FoReco2matrix(reco, temporal_names = temporal_names)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.