ces | R Documentation |
Function estimates CES in state space form with information potential equal to errors and returns several variables.
ces(data, seasonality = c("none", "simple", "partial", "full"),
lags = c(frequency(data)), formula = NULL, regressors = c("use",
"select", "adapt"), initial = c("backcasting", "optimal", "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, ...)
auto.ces(data, seasonality = c("none", "simple", "partial", "full"),
lags = c(frequency(data)), formula = NULL, regressors = c("use",
"select", "adapt"), initial = c("backcasting", "optimal", "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, ...)
ces_old(data, 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"), ...)
data |
Vector, containing data needed to be forecasted. If a matrix (or
data.frame / data.table) is provided, then the first column is used as a
response variable, while the rest of the matrix is used as a set of explanatory
variables. |
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. |
formula |
Formula to use in case of explanatory variables. If |
regressors |
The variable defines what to do with the provided explanatory
variables:
|
initial |
Should be a character, which 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.
In case of LASSO / RIDGE, the variables are not normalised prior to the estimation, but the parameters are divided by the mean values of explanatory variables. Note that model selection and combination works properly only for the default
Furthermore, just for fun the absolute and half analogues of multistep estimators
are available: Last but not least, user can provide their own function here as well, making sure
that it accepts parameters
|
h |
The forecast horizon. Mainly needed for the multistep loss functions. |
holdout |
Logical. If |
bounds |
The type of bounds for the persistence to use in the model
estimation. Can be either |
silent |
Specifies, whether to provide the progress of the function or not.
If |
model |
A previously estimated GUM model, if provided, the function will not estimate anything and will use all its parameters. |
... |
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/.
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.