robets (version 1.4)

robets: Robust exponential smoothing model

Description

Returns robets model applied to y.

Usage

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, ...)

Arguments

y

a numeric vector or time series

model

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.

damped

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.

alpha

Value of alpha. If NULL, it is estimated.

beta

Value of beta. If NULL, it is estimated.

gamma

Value of gamma. If NULL, it is estimated.

phi

Value of phi. If NULL, it is estimated.

additive.only

If TRUE, will only consider additive models. Default is FALSE.

lambda

Box-Cox transformation parameter. Ignored if NULL. Otherwise, data transformed before model is estimated. When lambda=TRUE, additive.only is set to FALSE.

lower

Lower bounds for the parameters (alpha, beta, gamma, phi)

upper

Upper bounds for the parameters (alpha, beta, gamma, phi)

opt.crit

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).

bounds

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.

ic

Information criterion to be used in model selection.

use.initial.values

If TRUE (default) and model is of class "robets", then the initial values in the model are also not re-estimated.

opt.initial.values

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".

rob.start.initial.values

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.

opt.sigma0

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.

k

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.

nmse

Number of steps for AMSE (1<=nmse<=30), nmse=1 is default.

...

Other undocumented arguments.

Value

An object of class "robets".

Details

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.

References

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

See Also

forecast.robets, plot.robets, plotOutliers, tau2, ets

Examples

Run this code
# NOT RUN {
library(forecast)
model <- robets(nottem)
plot(forecast(model))
# }

Run the code above in your browser using DataCamp Workspace