ces | R Documentation |
Function estimates CES in state space form with information potential equal to errors and returns several variables.
ces(y, seasonality = c("none", "simple", "partial", "full"),
lags = c(frequency(y)), initial = c("backcasting", "optimal",
"two-stage", "complete"), a = NULL, b = NULL, loss = c("likelihood",
"MSE", "MAE", "HAM", "MSEh", "TMSE", "GTMSE", "MSCE"), h = 0,
holdout = FALSE, bounds = c("admissible", "none"), silent = TRUE,
model = NULL, xreg = NULL, regressors = c("use", "select", "adapt"),
initialX = NULL, ...)
auto.ces(y, seasonality = c("none", "simple", "partial", "full"),
lags = c(frequency(y)), initial = c("backcasting", "optimal",
"two-stage", "complete"), ic = c("AICc", "AIC", "BIC", "BICc"),
loss = c("likelihood", "MSE", "MAE", "HAM", "MSEh", "TMSE", "GTMSE",
"MSCE"), h = 0, holdout = FALSE, bounds = c("admissible", "none"),
silent = TRUE, xreg = NULL, regressors = c("use", "select", "adapt"),
...)
ces_old(y, seasonality = c("none", "simple", "partial", "full"),
initial = c("backcasting", "optimal"), a = NULL, b = NULL,
ic = c("AICc", "AIC", "BIC", "BICc"), loss = c("likelihood", "MSE",
"MAE", "HAM", "MSEh", "TMSE", "GTMSE", "MSCE"), h = 10, holdout = FALSE,
bounds = c("admissible", "none"), silent = c("all", "graph", "legend",
"output", "none"), xreg = NULL, regressors = c("use", "select"),
initialX = NULL, ...)
y |
Vector or ts object, containing data needed to be forecasted. |
seasonality |
The type of seasonality used in CES. Can be: In case of the |
lags |
Vector of lags to use in the model. Allows defining multiple seasonal models. |
initial |
Can be either character or a list, or a vector of initial states.
If it is character, then it can be |
a |
First complex smoothing parameter. Should be a complex number. NOTE! CES is very sensitive to a and b values so it is advised either to leave them alone, or to use values from previously estimated model. |
b |
Second complex smoothing parameter. Can be real if
|
loss |
The type of Loss Function used in optimization. There are also available analytical approximations for multistep functions:
Finally, just for fun the absolute and half analogues of multistep estimators
are available: |
h |
Length of forecasting horizon. |
holdout |
If |
bounds |
The type of bounds for the persistence to use in the model
estimation. Can be either |
silent |
accepts |
model |
A previously estimated GUM model, if provided, the function will not estimate anything and will use all its parameters. |
xreg |
The vector (either numeric or time series) or the matrix (or
data.frame) of exogenous variables that should be included in the model. If
matrix included than columns should contain variables and rows - observations.
Note that |
regressors |
The variable defines what to do with the provided xreg:
|
initialX |
The vector of initial parameters for exogenous variables.
Ignored if |
... |
Other non-documented parameters. See adam for
details. However, there are several unique parameters passed to the optimiser
in comparison with |
ic |
The information criterion to use in the model selection. |
The function estimates Complex Exponential Smoothing in the state space form described in Svetunkov et al. (2022) with the information potential equal to the approximation error.
The auto.ces()
function implements the automatic seasonal component
selection based on information criteria.
ces_old()
is the old implementation of the model and will be discontinued
starting from smooth v4.5.0.
ces()
uses two optimisers to get good estimates of parameters. By default
these are BOBYQA and then Nelder-Mead. This can be regulated via ...
- see
details below.
For some more information about the model and its implementation, see the
vignette: vignette("ces","smooth")
Object of class "adam" is returned with similar elements to the adam function.
Ivan Svetunkov, ivan@svetunkov.com
Svetunkov I. (2023) Smooth forecasting with the smooth package in R. arXiv:2301.01790. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2301.01790")}.
Svetunkov I. (2015 - Inf) "smooth" package for R - series of posts about the underlying models and how to use them: https://openforecast.org/category/r-en/smooth/.
Svetunkov, I. (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM) (1st ed.). Chapman and Hall/CRC. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/9781003452652")}, online version: https://openforecast.org/adam/.
Svetunkov, I., 2023. Smooth Forecasting with the Smooth Package in R. arXiv. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2301.01790")}
Snyder, R. D., 1985. Recursive Estimation of Dynamic Linear Models. Journal of the Royal Statistical Society, Series B (Methodological) 47 (2), 272-276.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-540-71918-2")}.
Svetunkov, I., Kourentzes, N., & Ord, J. K. (2022). Complex exponential smoothing. Naval Research Logistics, 69(8), 1108–1123. https://doi.org/10.1002/nav.22074
adam, es
y <- rnorm(100,10,3)
ces(y, h=20, holdout=FALSE)
y <- 500 - c(1:100)*0.5 + rnorm(100,10,3)
ces(y, h=20, holdout=TRUE)
ces(BJsales, h=8, holdout=TRUE)
ces(AirPassengers, h=18, holdout=TRUE, seasonality="s")
ces(AirPassengers, h=18, holdout=TRUE, seasonality="p")
ces(AirPassengers, h=18, holdout=TRUE, seasonality="f")
y <- ts(rnorm(100,10,3),frequency=12)
# CES with and without holdout
auto.ces(y,h=20,holdout=TRUE)
auto.ces(y,h=20,holdout=FALSE)
# Selection between "none" and "full" seasonalities
auto.ces(AirPassengers, h=12, holdout=TRUE,
seasonality=c("n","f"), ic="AIC")
ourModel <- auto.ces(AirPassengers)
summary(ourModel)
forecast(ourModel, h=12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.