Hi!
I am trying to run the examples in section 12.2 Prophet Model from the textbook Forecasting: Principles and Practice (3rd ed.). I am running into some errors probably because I have not loaded the necessary packages. Unfortunately, the necessary packages are not specified in section 12.2.
I have been trying to decipher which packages I may need, but without luck. E.g. I am not even able to run the first line correctly. I have loaded tsibbledata
and added attach(aus_production)
in the beginning to get rid of the first error message, but I still get
Error in year(Quarter) : could not find function "year"
.
If I circumvent it somehow (not elegantly at all!), the third line
> fit <- train |>
+ model(
+ arima = ARIMA(Cement),
+ ets = ETS(Cement),
+ prophet = prophet(Cement ~ season(period=4, order=2, type="multiplicative"))
+ )
produces the error below:
Error in UseMethod("model") : no applicable method for 'model' applied to an object of class "c('mts', 'ts')"
Please help. Thank you!
Referred here by Forecasting: Principles and Practice, by Rob J Hyndman and George Athanasopoulos