Search code examples
rtime-seriestidyversefable-r

Fable forecast data set requests and functions


does any one have the dataset requirements for fable package in R here some problems I had, any one can give any suggestion will be nice. my R version is

platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 5.2
year 2018
month 12
day 20
svn rev 75870
language R
version.string R version 3.5.2 (2018-12-20) nickname Eggshell Igloo

  1. could I use irregular time data for modeling? say: I have price data for 250 days out of 365 days but I still want to use fable to model ARIMA of the price. is that possible? the example form github is uesing tsibbledata::ausretail has no missing date in the data set

  2. seems the commend the fable pacakge grammar changed I was using the example from this page 2018-12 it was fine https://github.com/mitchelloharawild/fable-tfeam-2018/blob/master/index.Rmd

but now I am not able to use the code. e.g. the ETS was using

fbl_cafe_fit <- vic_cafe %>%
  fable::ETS(Turnover ~ season("M"))

now from this page, people need to put extra 'model' outside?? https://github.com/tidyverts/fable

    UKLungDeaths %>%
  model(ets = ETS(log(mdeaths))) %>%
  forecast

is that new grammar or my understanding is wrong?

  1. Seems now i do not have auto.arima () option from fable any more??? i need to specify pdq() and PDQ()

    USAccDeaths %>% as_tsibble %>% model(arima = ARIMA(log(value) ~ pdq(0,1,1) + PDQ(0,1,1)))

  2. after i fit the arima model, i also have problem use the fitting model to predict next period this grammar not work any more:

    fbl_cafe_fc <- fbl_cafe_fit %>% forecast(h=24)


Solution

    1. ARIMA requires a regular time series, however it will also work in the presence of missing values. You can use tsibble::fill_gaps() to convert implicit missing values to explicit.

    2. Correct, the fable package is currently experimental and changes to the interface are expected to continue. These changes will likely have a relatively minor impact on users. Since the fable TFEAM talk, we now support multiple model columns in a mable. To achieve this, we now use model() to specify models. Previously, if you wanted to model data %>% ETS(log(y) ~ season("A")), this is now data %>% model(ETS(log(y) ~ season("A")).

    3. Automatic model selection (such as forecast::auto.arima()) is contained within the same function in fable (ARIMA()). When estimating a model, if the right-hand-side is left empty, a model will be chosen automatically from the defaults. For ARIMA models, if you used data %>% model(ARIMA(y)), an appropriate model will be automatically chosen (same as forecast::auto.arima()). You can also now estimate an ARIMA(p,0,0)(2,1,Q)[12] model, where p and Q are unknown between 0 and 3. To do this, you would use data %>% model(ARIMA(y ~ pdq(0:3, 0, 0) + PDQ(2, 1, 0:3, period = 12))).

    4. That code looks correct, and should still work. Perhaps you need to update the packages.