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))))
# (3 x 70) in-sample residuals matrix (simulated)
res <- rbind(rnorm(70), rnorm(70), rnorm(70))
A <- t(c(1,1)) # Aggregation matrix for Z = X + Y
m <- 4 # from quarterly to annual temporal aggregation
rtcs <- tcsrec(base = base,
cslist = list(agg_mat = A, comb = "shr"),
telist = list(agg_order = m, comb = "wlsv"),
res = res)
rcst <- tcsrec(base = base,
cslist = list(agg_mat = A, comb = "shr"),
telist = list(agg_order = m, comb = "wlsv"),
res = res)
Run the code above in your browser using DataLab