我在预测多个时间序列时面临多层次的层次结构。
这是我的结构样本:
Total
=> A
=> 19 time series
=> B
=> 10 time series
所以我需要将31个时间序列移交给hts函数。
我试过
nodes <- list(2, rep(1, 19), rep(1, 10))
但只有这个:
Error: The number of terminal nodes is not consistent with the number of bottom time series.
我检查了这个(How to use ‘hts’ with multi-level hierarchies?),但也没有帮助我。
如果有人能帮助我找到节点将正确的层次结构移交给hts函数,那真是太棒了。
修改
我能够自己找到解决方案:
nodes <- list(2,c(19,10))
除此之外,我还必须使用仅包含29(19 + 10)个时间序列的时间序列帧。不是汇总的(A / B)。