要使用生成概率预测,{thief}
您需要将寓言转换为{forecast}
样式forecast
对象。对象的基本最小结构forecast
(以及如何从寓言分布中产生它,可以通过 为先知获得{fable.prophet}
)是:
library(forecast)
library(distributional)
dist <- dist_normal(1:10)
structure(
list(
# A time series of the forecast means
mean = ts(mean(dist)),
# A matrix time series of the forecast interval's upper bound
upper = ts(cbind("80%" = quantile(dist, 0.90), "95%" = quantile(dist, 0.975))),
# A matrix time series of the forecast interval's lower bound
lower = ts(cbind("80%" = quantile(dist, 0.10), "95%" = quantile(dist, 0.025))),
# A vector containing forecast interval levels in order of appearance
level = c(80, 95)
),
class = "forecast"
)
#> Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
#> 1 1 -0.2815516 2.281552 -0.95996398 2.959964
#> 2 2 0.7184484 3.281552 0.04003602 3.959964
#> 3 3 1.7184484 4.281552 1.04003602 4.959964
#> 4 4 2.7184484 5.281552 2.04003602 5.959964
#> 5 5 3.7184484 6.281552 3.04003602 6.959964
#> 6 6 4.7184484 7.281552 4.04003602 7.959964
#> 7 7 5.7184484 8.281552 5.04003602 8.959964
#> 8 8 6.7184484 9.281552 6.04003602 9.959964
#> 9 9 7.7184484 10.281552 7.04003602 10.959964
#> 10 10 8.7184484 11.281552 8.04003602 11.959964
由reprex 包于 2020-12-10 创建(v0.3.0)
然后,您可以使用这些预测结构thief::reconcilethief()
来协调它们。
也就是说,目前正在为{fable}
. 相关的开发问题在这里:https ://github.com/tidyverts/fabletools/issues/59
协调每日或次日时间到每月和每年的层次结构有一些复杂性,但尚未实施,但目前的原型适用于 >monthly 底部水平。最近在 ISF2020 上的演示介绍了与以下内容的时间和解{fable}
:https ://www.youtube.com/watch?v=6D7rNHZ5E-Q&t=1120
值得注意的是,间隔{thief}
只是来自较高时间频率的间隔之和。这些间隔不是最优的,因此将不同于由 给出的最优概率预测分布{fable}
。