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
ts_oct <- FoReco2ts(recf = oct_recf, m = 12, start = c(15, 1))
mat_oct <- FoReco2matrix(recf = oct_recf, m = 12)
# Cross-sectional framework
# monthly base forecasts
mbase <- FoReco2matrix(FoReco_data$base, m = 12)$k1
# monthly residuals
mres <- FoReco2matrix(FoReco_data$res, m = 12)$k1
hts_recf <- htsrec(mbase, C = FoReco_data$C, comb = "shr", res = mres)$recf
ts_hts <- FoReco2ts(recf = hts_recf, start = c(15, 1), frequency = 12)
mat_hts <- FoReco2matrix(recf = hts_recf)
# 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
ts_thf <- FoReco2ts(recf = thf_recf, m = 12, start = c(15, 1))
mat_thf <- FoReco2matrix(recf = thf_recf, m = 12)
Run the code above in your browser using DataLab