我试图了解两个预测包之间的区别forecast
,fable
因为同一本书的两个版本(第二版和第三版似乎暗示这两个包是等效的。
library(dplyr)
raw <- c(44.4082519001086, 47.1074380165289, 43.5633367662204, 43.1003584229391,
42.5828970331588, 38.3217993079585, 38.5751520417029)
# raw <- c(raw,rev(raw))
forecast.df <- ts(raw)
forecast::autoplot(forecast.df) +
forecast::autolayer(forecast::holt(forecast.df,damped=FALSE,h = 5),
series="Holt's method",PI = TRUE)
fable.df <- tsibble::as_tsibble(tibble(value=raw) %>%
mutate(time=1:n()),index=time)
fable.df %>%
fabletools::model(`Holt's method`=
fable::ETS(value ~ error("A") + trend("A") + season("N"))) %>%
fabletools::forecast(.,h=5) %>%
fabletools::autoplot(fable.df,level=c(80,95))
通过观察这两个图表,与漏斗形生成的预测区间边界fabletools
相比,生成的预测区间边界是平行的。forecast
我不确定我在设置时是否遗漏了一些参数forecast
或fable
. 谢谢!