Skip to content

Instantly share code, notes, and snippets.

@erichare
Created July 17, 2019 13:26
Show Gist options
  • Save erichare/16a6ca1b43fa6ce590bdcc4e9f4d443a to your computer and use it in GitHub Desktop.
Save erichare/16a6ca1b43fa6ce590bdcc4e9f4d443a to your computer and use it in GitHub Desktop.
Sample code to forecast Air Passengers using the Fable package
library(tidyverse)
library(fable)
fable_series <- AirPassengers %>%
as_tsibble() %>%
model(
ets = ETS(box_cox(value, 0.3)),
arima = ARIMA(value),
snaive = SNAIVE(value)
) %>%
forecast(h = "2 years")
autoplot(fable_series)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment