Forecasting Using State Space Models

Functions implementing Single Source of Error state space models for purposes of time series analysis and forecasting. The package includes ADAM (Svetunkov, 2023, < https://openforecast.org/adam/>), Exponential Smoothing (Hyndman et al., 2008, ), SARIMA (Svetunkov & Boylan, 2019 ), Complex Exponential Smoothing (Svetunkov & Kourentzes, 2018, ), Simple Moving Average (Svetunkov & Petropoulos, 2018 ) and several simulation functions. It also allows dealing with intermittent demand based on the iETS framework (Svetunkov & Boylan, 2019, ).


smooth

License: LGPL-2.1

R:

CRAN_Status_Badge Downloads R-CMD-check

Conda version Conda downloads

Python:

PyPI version PyPI - Downloads Python versions Python CI SLSA Build Level 3

Python wheels on PyPI ship with PEP 740 attestations — SLSA Build Level 3 provenance, signed via Sigstore on the GitHub Actions runner that built them. Verifiable client-side with pypi-attestations.

The smooth package implements Single Source of Error (SSOE) state-space models for forecasting and time series analysis, available for both R and Python.

hex-sticker of the smooth package for R hex-sticker of the smooth package for Python

Both the R and Python versions of smooth depend on the greybox package for distributions, information criteria, and supporting utilities (in Python this also provides the LOWESS smoother). It is installed automatically with smooth.

Installation

R (CRAN):

install.packages("smooth")

R (github):

if (!require("remotes")) install.packages("remotes")
remotes::install_github("openforecast-org/smooth")

Python (PyPI):

pip install smooth

Python (github, dev):

pip install "git+https://github.com/openforecast-org/smooth.git@master#subdirectory=python"

For development versions and system requirements, see the Installation wiki page.

Quick Examples

R

library(smooth)

# ADAM - the recommended function for most tasks
model <- adam(y, model="ZXZ", lags=12)
forecast(model, h=12)

# Exponential Smoothing
model <- es(y, model="ZXZ", lags=12)

# Automatic model selection for ETS+ARIMA and distributions
model <- auto.adam(y, model="ZZZ",
                   orders=list(ar=2, i=2, ma=2, select=TRUE))

Python

from smooth import ADAM, ES

# ADAM model
model = ADAM(model="ZXZ", lags=12)
model.fit(y)
model.predict(h=12)

# Exponential Smoothing
model = ES(model="ZXZ")
model.fit(y)

Documentation

Full documentation is available on the GitHub Wiki, including:

Book: Svetunkov, I. (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM). Chapman and Hall/CRC. Online: https://openforecast.org/adam/

About

smooth is developed and maintained by OpenForecast, a demand forecasting and inventory management consultancy. The package implements the methods we use in our consulting and teach in our training courses.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("smooth")

4.5.2 by Ivan Svetunkov, a month ago


https://openforecast.org/packages/


Report a bug at https://github.com/openforecast-org/smooth/issues


Browse source code at https://github.com/cran/smooth


Authors: Ivan Svetunkov [aut, cre] (Director of the OpenForecast consultancy company , UK , ORCID:


Documentation:   PDF Manual  


LGPL-2.1 license


Imports Rcpp, stats, generics, graphics, grDevices, methods, statmod, MASS, nloptr, utils, xtable, zoo

Depends on greybox

Suggests legion, numDeriv, testthat, knitr, rmarkdown, doMC, doParallel, foreach

Linking to Rcpp, RcppArmadillo


Imported by lablaster.

Depended on by MAPA, legion, muse.

Suggested by greybox, healthyR.ts, mlr3forecast, modeltime.


See at CRAN