Returns robets model applied to y
.
robets(y, model = "ZZZ", damped = NULL, alpha = NULL, beta = NULL,
gamma = NULL, phi = NULL, additive.only = FALSE, lambda = NULL,
lower = c(rep(1e-04, 3), 0.8), upper = c(rep(0.9999, 3), 0.98),
opt.crit = c("roblik", "tau2", "lik", "mse", "amse", "sigma", "mae"),
bounds = c("both", "usual", "admissible"), ic = c("robaicc", "robaic",
"robbic", "aicc", "bic", "aic"), use.initial.values = TRUE,
opt.initial.values = FALSE, rob.start.initial.values = TRUE,
opt.sigma0 = FALSE, k = 3, nmse = 1, ...)
a numeric vector or time series
A three-letter string indicating the method using the framework terminology of Hyndman et al. (2008). The first letter denotes the error type ("A", "M" or "Z"); the second letter denotes the trend type ("N","A" or "Z"); and the third letter denotes the season type ("N","A","M" or "Z"). In all cases, "N"=none, "A"=additive, "M"=multiplicative and "Z"=automatically selected. So, for example, "ANN" is simple exponential smoothing with additive errors, "MAM" is multiplicative Holt-Winters' method with multiplicative errors, and so on. It is also possible for the model to be of class "robets
", and equal to the output from a previous call to robets
. In this case, the same model is fitted to y
without re-estimating any smoothing parameters. See also the use.initial.values
argument.
If TRUE, use a damped trend. If NULL, both damped and non-damped trends will be tried and the best model (according to the information criterion ic
) will be returned.
Value of alpha. If NULL, it is estimated.
Value of beta. If NULL, it is estimated.
Value of gamma. If NULL, it is estimated.
Value of phi. If NULL, it is estimated.
If TRUE, will only consider additive models. Default is FALSE.
Box-Cox transformation parameter. Ignored if NULL. Otherwise, data transformed before model is estimated. When lambda=TRUE
, additive.only
is set to FALSE.
Lower bounds for the parameters (alpha, beta, gamma, phi)
Upper bounds for the parameters (alpha, beta, gamma, phi)
Optimization criterion. One of "roblik" (Robust Log-likelihood, default), "tau2" (Tau squared error of the residuals), "mse" (Mean Square Error), "amse" (Average MSE over first nmse
forecast horizons), "sigma" (Standard deviation of residuals), "mae" (Mean of absolute residuals), or "lik" (Log-likelihood).
Type of parameter space to impose: "usual"
indicates all parameters must lie between specified lower and upper bounds; "admissible"
indicates parameters must lie in the admissible space; "both"
(default) takes the intersection of these regions.
Information criterion to be used in model selection.
If TRUE
(default) and model
is of class "robets"
, then the initial values in the model are also not re-estimated.
If FALSE
(default) a robust heuristic is used for chosing the initial values. If TRUE
the initial values are part of the problem to optimize opt.crit
. Neglected if use.initial.values
is TRUE
and model
is of class "robets"
.
If TRUE
(default) the initial values are computed via the robust heuristic described in Crevits and Croux (2016). If FALSE
the initial values are computed via the same heuristic as in Hyndman et al. (2008). The initial values computed with these methods are further optimized if opt.initial.values
is TRUE
.
If FALSE
(default) sigma0 is equal to the value computed together with the other initial values via a heuristic. If TRUE
sigma0 is included as a variable in the optimization problem. It is not recommended to set opt.sigma0 = TRUE
.
Value of k in forecasting equations. k=3
is default. If NULL, k
is included as a variable in the optimization problem. It is not recommended to set k = NULL
.
Number of steps for AMSE (1<=nmse
<=30), nmse=1
is default.
Other undocumented arguments.
An object of class "robets
".
The code is an extended version of the code of the function ets
of the package forecast
of Hyndman and Khandakar (2008). The methodology is an extended version of Gelper et al. (2008). In Crevits and Croux (2016) the methodology of robets
is described in full.
Crevits, R., and Croux, C (2016) "Forecasting with Robust Exponential Smoothing with Damped Trend and Seasonal Components".Working paper. https://doi.org/10.13140/RG.2.2.11791.18080
Gelper S., Fried R. and Croux C. (2010) "Robust Forecasting with Exponential and Holt-Winters Smoothing".Journal of Forecasting, 29, 285-300. https://doi.org/10.1002/for.1125
Hyndman, R. J., and Khandakar, Y (2008) "Automatic time series forecasting: The forecasting package for R".Journal of Statistical Software 27(3). https://doi.org/10.18637/jss.v027.i03
# NOT RUN {
library(forecast)
model <- robets(nottem)
plot(forecast(model))
# }
Run the code above in your browser using DataCamp Workspace