I have to forecast a large set of (hierarchical) time series and since the R package hts allows for confidence intervals for their ensemble, I'd like to use it. I haven't found an example of how to use it, yet. How should I forecast the following series with it: The time series have a simple form. The sum of $n_3$ level-$3$-series make up a level-$2$-series and the sum of $n_2$ level-$2$-series make up a level-$1$-series and the sum of $n_1$ level-$1$-series make up the top-most level-$0$-series (where sums are taken over series in one point in time, $n_j$ natural numbers for $j=0,1,2,3$).
Here is one example taken from the documentation in the package:
abc <- ts(5 + matrix(sort(rnorm(200)), ncol = 4, nrow = 100)) x <- hts(abc, c(1,1,2,2)) y <- gts(abc, rbind(c(1,1,2,2), c(1,2,1,2)))
The first line generates a matrix of four time series, each of 100 observations. The second line interprets the four time series as hierarchical, with the first two series in one group and the second two series in a second group:
Total | |-------| A B | | ----- ----- | | | | A1 A2 B1 B2
This gives seven series in all including the aggregations.
> x Hierarchical Time Series 3 Levels Number of series at each level: 1 2 4 Total number of series: 7 Number of observations per series: 100
The third line of the example interprets the four series as grouped rather than hierarchical, with one grouping variable treating the first two series in one group and the remaining two series in the second group. The other grouping variable takes the first and third series in one group and the second and fourth in the other group. So in this interpretation, the four series can be grouped as in the hierarchy above, or as in the hierarchy below:
Total | |-------| X Y | | ----- ----- | | | | A1 B1 A2 B2
So there are nine series in all under this structure, due to the additional grouping variable.
> y Grouped Time Series 4 Levels Number of groups at each level: 1 2 2 4 Total number of series: 9 Number of observations per series: 100