问题
I am trying to understand the different between two forecasting package forecast
and fable
, as the two editions of the same book (second edition and third edition seems to imply that the two packages are equivalent.
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))
By eyeballing the two charts, the boundaries of prediction interval generated by fabletools
are parallel, compared with those generated by forecast
being in funnel shape.
I am not sure if I have missed some parameters when setting up forecast
or fable
. Thanks!
来源:https://stackoverflow.com/questions/64854538/forecast-and-fable-return-different-outputs-on-same-dataset-for-forecasting-in-r