# NOT RUN {
data(FoReco_data)
# Cross-temporal framework
oct_recf <- octrec(FoReco_data$base, m = 12, C = FoReco_data$C,
comb = "bdshr", res = FoReco_data$res)$recf
obj_oct <- FoReco2ts(recf = oct_recf, start = c(15, 1))
# Cross-sectional framework
# monthly base forecasts
id <- which(simplify2array(strsplit(colnames(FoReco_data$base),
split = "_"))[1, ] == "k1")
mbase <- t(FoReco_data$base[, id])
# monthly residuals
id <- which(simplify2array(strsplit(colnames(FoReco_data$res),
split = "_"))[1, ] == "k1")
mres <- t(FoReco_data$res[, id])
hts_recf <- htsrec(mbase, C = FoReco_data$C, comb = "shr", res = mres)$recf
obj_hts <- FoReco2ts(recf = hts_recf, start = c(15, 1), frequency = 12)
# Temporal framework
# top ts base forecasts ([lowest_freq' ... highest_freq']')
topbase <- FoReco_data$base[1, ]
# top ts residuals ([lowest_freq' ... highest_freq']')
topres <- FoReco_data$res[1, ]
thf_recf <- thfrec(topbase, m = 12, comb = "acov", res = topres)$recf
obj_thf <- FoReco2ts(recf = thf_recf, start = c(15, 1))
# }
Run the code above in your browser using DataLab