2

I've been playing around with forecast, fable, and tibble, and was working through Rob Hyndman's examples HERE. When I get to the end of the "auscafe" example, the autoplot that comes out is ONLY for the forecast, not the original plot PLUS the forecast as shown (and expected).

What am I missing here?

library(fpp2)
library(tsibble)
library(fable)
data("auscafe")

# Make auscafe a tsibble and confirm 
cafe <- as_tsibble(auscafe)
cafe


# Take a look
autoplot(cafe)

# ETS model noodling after Hyndman's 2018 presentation  
# https://robjhyndman.com/seminars/isf-fable/

cafe %>% ETS(value) %>% summary

cafe %>% ETS(value) %>% forecast() %>% summary()

cafe %>% ETS(value) %>% forecast() %>% summary(level=90)

# See Hyndman slide 11: He gets the original series PLUS the forecast
# When I run this, I get a plot of ONLY the forecast, 
# i.e., 2008-07 to 2010-07

cafe %>% ETS(value) %>% forecast() %>% autoplot()
Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55
Steph
  • 118
  • 8
  • thanks for bringing this issue up. I've tried using some of these packages in the past, and I think that they are still in the developmental stages. I know it's not much of an answer for now (I couldn't even get tsibble correctly installed on my computer today), but maybe someone else will have one soon. – shuckle Dec 31 '18 at 22:49
  • 1
    Yep. I also had to try a couple of times to get tsibble installed. I found that restarting the R session helped, as does detaching all other packages. I'm also having trouble with the ARIMA function in fable throwing inexplicable errors. There seems to be some "arguing" when you have forecast and fable loaded at the same time. Harumf. Oh well, all part of the process I guess. – Steph Dec 31 '18 at 23:20

1 Answers1

4

I also posted this on the tidyverts/fable git repo and got this excellent response from Mitchell O'Hara-Wild:

Since the presentation the package has undergone several changes as we figure out the best way to implement the features.

At the time of the presentation, the fable package was simply a wrapper to the forecast package, and so fable::ARIMA would call forecast::auto.arima. Since then, the ARIMA method has been re-implemented from scratch, and as the error states, currently does not support selection of differences. For now, the order of integration must be specified with model specials. For example, pdq(d=1) + PDQ(D=1) would include both a seasonal and non-seasonal difference. This functionality will be added in the near future.

We've also changed how forecasts work. Forecasts now contain only future predicted values, and so the data used to train the model is no longer included. The historical data for the forecasts can be included by providing the data as the first argument to autoplot.

prison %>% ETS(count) %>% forecast() %>% autoplot(prison)
Steph
  • 118
  • 8