This function returns the summing matrix for a hierarchical or grouped time series, as defined in Hyndman et al. (2011).

smatrix(xts)

Arguments

xts

Hierarchical or grouped time series of class gts.

Value

A numerical matrix.

References

Hyndman, R. J., Ahmed, R. A., Athanasopoulos, G., & Shang, H. L. (2011). Optimal combination forecasts for hierarchical time series. Computational Statistics and Data Analysis, 55(9), 2579--2589. https://robjhyndman.com/publications/hierarchical/

See also

Author

Earo Wang

Examples


smatrix(htseg1)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    1    1    1    1
#> [2,]    1    1    1    0    0
#> [3,]    0    0    0    1    1
#> [4,]    1    0    0    0    0
#> [5,]    0    1    0    0    0
#> [6,]    0    0    1    0    0
#> [7,]    0    0    0    1    0
#> [8,]    0    0    0    0    1