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

17,669

Version

0.3.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Last Published

March 22nd, 2023

Functions in fable (0.3.3)

RW

Random walk models
AR

Estimate a AR model
CROSTON

Croston's method
THETA

Theta method
ARIMA

Estimate an ARIMA model
NNETAR

Neural Network Time Series Forecasts
MEAN

Mean models
components.ETS

Extract estimated states from an ETS model.
TSLM

Fit a linear model with time series components
fitted.ETS

Extract fitted values from a fable model
common_xregs

Common exogenous regressors
breusch_godfrey

Breusch-Godfrey Test
forecast.TSLM

Forecast a model from the fable package
ETS

Exponential smoothing state space model
fitted.ARIMA

Extract fitted values from a fable model
VAR

Estimate a VAR model
fitted.AR

Extract fitted values from a fable model
forecast.RW

Forecast a model from the fable package
forecast.fable_theta

Forecast a model from the fable package
forecast.AR

Forecast a model from the fable package
forecast.ARIMA

Forecast a model from the fable package
forecast.model_mean

Forecast a model from the fable package
fitted.RW

Extract fitted values from a fable model
fitted.TSLM

Extract fitted values from a fable model
generate.model_mean

Generate new data from a fable model
fable-package

fable: Forecasting Models for Tidy Time Series
glance.AR

Glance a AR
generate.RW

Generate new data from a fable model
refit.ETS

Refit an ETS model
refit.NNETAR

Refit a NNETAR model
generate.ETS

Generate new data from a fable model
refit.AR

Refit an AR model
generate.NNETAR

Generate new data from a fable model
glance.TSLM

Glance a TSLM
fitted.VAR

Extract fitted values from a fable model
fitted.croston

Extract fitted values from a fable model
interpolate.ARIMA

Interpolate missing values from a fable model
glance.fable_theta

Glance a theta method
reexports

Objects exported from other packages
generate.TSLM

Generate new data from a fable model
glance.model_mean

Glance a average method model
interpolate.TSLM

Interpolate missing values from a fable model
residuals.TSLM

Extract residuals from a fable model
residuals.ARIMA

Extract residuals from a fable model
glance.ARIMA

Glance an ARIMA model
residuals.VAR

Extract residuals from a fable model
generate.ARIMA

Generate new data from a fable model
fitted.fable_theta

Extract fitted values from a fable model
fitted.NNETAR

Extract fitted values from a fable model
tidy.NNETAR

Tidy a fable model
residuals.ETS

Extract residuals from a fable model
unitroot_options

Options for the unit root tests for order of integration
tidy.fable_theta

Tidy a fable model
tidy.RW

Tidy a fable model
tidy.model_mean

Tidy a fable model
tidy.croston

Tidy a fable model
residuals.croston

Extract residuals from a fable model
tidy.TSLM

Tidy a fable model
glance.VAR

Glance a VAR
refit.ARIMA

Refit an ARIMA model
tidy.VAR

Tidy a fable model
residuals.fable_theta

Extract residuals from a fable model
fitted.model_mean

Extract fitted values from a fable model
interpolate.model_mean

Interpolate missing values from a fable model
residuals.NNETAR

Extract residuals from a fable model
glance.ETS

Glance an ETS model
tidy.ARIMA

Tidy a fable model
refit.model_mean

Refit a MEAN model
residuals.RW

Extract residuals from a fable model
residuals.AR

Extract residuals from a fable model
forecast.croston

Forecast a model from the fable package
forecast.NNETAR

Forecast a model from the fable package
forecast.VAR

Forecast a model from the fable package
forecast.ETS

Forecast a model from the fable package
generate.AR

Generate new data from a fable model
residuals.model_mean

Extract residuals from a fable model
glance.NNETAR

Glance a NNETAR model
glance.RW

Glance a lag walk model
tidy.AR

Tidy a fable model
refit.TSLM

Refit a TSLM
refit.RW

Refit a lag walk model
tidy.ETS

Tidy a fable model