Learn R Programming

⚠️There's a newer version (0.4.0) of this package.Take me there.

fable

The R package fable provides a collection of commonly used univariate and multivariate time series forecasting models including exponential smoothing via state space models and automatic ARIMA modelling. These models work within the fable framework, which provides the tools to evaluate, visualise, and combine models in a workflow consistent with the tidyverse.

Installation

You can install the stable version from CRAN:

install.packages("fable")

You can install the development version from GitHub

# install.packages("remotes")
remotes::install_github("tidyverts/fable")

Installing this software requires a compiler

Example

library(fable)
library(tsibble)
library(tsibbledata)
library(lubridate)
library(dplyr)
aus_retail %>%
  filter(
    State %in% c("New South Wales", "Victoria"),
    Industry == "Department stores"
  ) %>% 
  model(
    ets = ETS(box_cox(Turnover, 0.3)),
    arima = ARIMA(log(Turnover)),
    snaive = SNAIVE(Turnover)
  ) %>%
  forecast(h = "2 years") %>% 
  autoplot(filter(aus_retail, year(Month) > 2010), level = NULL)

Learning to forecast with fable

  • The pkgdown site describes all models provided by fable, and how they are used: https://fable.tidyverts.org/
  • The forecasting principles and practices online textbook provides an introduction to time series forecasting using fable: https://otexts.com/fpp3/ (WIP)

Getting help

  • Questions about forecasting can be asked on Cross Validated.

  • Common questions about the fable package are often found on Stack Overflow. You can use this to ask for help if the question isn’t already answered. A minimally reproducible example that describes your issue is the best way to ask for help!

Copy Link

Version

Install

install.packages('fable')

Monthly Downloads

13,801

Version

0.3.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Mitchell O'Hara-Wild

Last Published

September 1st, 2022

Functions in fable (0.3.2)

MEAN

Mean models
NNETAR

Neural Network Time Series Forecasts
AR

Estimate a AR model
ETS

Exponential smoothing state space model
ARIMA

Estimate an ARIMA model
CROSTON

Croston's method
fitted.NNETAR

Extract fitted values from a fable model
fitted.ETS

Extract fitted values from a fable model
TSLM

Fit a linear model with time series components
VAR

Estimate a VAR model
fitted.RW

Extract fitted values from a fable model
THETA

Theta method
RW

Random walk models
fitted.TSLM

Extract fitted values from a fable model
fable-package

fable: Forecasting Models for Tidy Time Series
components.ETS

Extract estimated states from an ETS model.
breusch_godfrey

Breusch-Godfrey Test
common_xregs

Common exogenous regressors
fitted.AR

Extract fitted values from a fable model
forecast.ETS

Forecast a model from the fable package
forecast.NNETAR

Forecast a model from the fable package
fitted.ARIMA

Extract fitted values from a fable model
forecast.AR

Forecast a model from the fable package
forecast.TSLM

Forecast a model from the fable package
forecast.RW

Forecast a model from the fable package
forecast.ARIMA

Forecast a model from the fable package
fitted.model_mean

Extract fitted values from a fable model
fitted.fable_theta

Extract fitted values from a fable model
forecast.fable_theta

Forecast a model from the fable package
forecast.model_mean

Forecast a model from the fable package
generate.ARIMA

Generate new data from a fable model
generate.AR

Generate new data from a fable model
forecast.VAR

Forecast a model from the fable package
glance.model_mean

Glance a average method model
forecast.croston

Forecast a model from the fable package
glance.fable_theta

Glance a theta method
generate.NNETAR

Generate new data from a fable model
glance.RW

Glance a lag walk model
glance.NNETAR

Glance a NNETAR model
generate.ETS

Generate new data from a fable model
fitted.croston

Extract fitted values from a fable model
fitted.VAR

Extract fitted values from a fable model
generate.model_mean

Generate new data from a fable model
glance.AR

Glance a AR
glance.TSLM

Glance a TSLM
glance.VAR

Glance a VAR
refit.ETS

Refit an ETS model
refit.NNETAR

Refit a NNETAR model
refit.model_mean

Refit a MEAN model
refit.TSLM

Refit a TSLM
refit.RW

Refit a lag walk model
glance.ARIMA

Glance an ARIMA model
generate.RW

Generate new data from a fable model
generate.TSLM

Generate new data from a fable model
refit.ARIMA

Refit an ARIMA model
residuals.ARIMA

Extract residuals from a fable model
refit.AR

Refit an AR model
residuals.croston

Extract residuals from a fable model
tidy.RW

Tidy a fable model
tidy.ARIMA

Tidy a fable model
tidy.ETS

Tidy a fable model
tidy.croston

Tidy a fable model
residuals.ETS

Extract residuals from a fable model
tidy.AR

Tidy a fable model
residuals.model_mean

Extract residuals from a fable model
residuals.AR

Extract residuals from a fable model
residuals.fable_theta

Extract residuals from a fable model
tidy.NNETAR

Tidy a fable model
residuals.RW

Extract residuals from a fable model
residuals.NNETAR

Extract residuals from a fable model
reexports

Objects exported from other packages
glance.ETS

Glance an ETS model
interpolate.model_mean

Interpolate missing values from a fable model
interpolate.TSLM

Interpolate missing values from a fable model
interpolate.ARIMA

Interpolate missing values from a fable model
residuals.VAR

Extract residuals from a fable model
residuals.TSLM

Extract residuals from a fable model
tidy.VAR

Tidy a fable model
tidy.TSLM

Tidy a fable model
tidy.fable_theta

Tidy a fable model
tidy.model_mean

Tidy a fable model
unitroot_options

Options for the unit root tests for order of integration