Package robets. March 6, Type Package

Similar documents
Package forecasthybrid

Package TVsMiss. April 5, 2018

Package ECctmc. May 1, 2018

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

Package basictrendline

Package bayesdp. July 10, 2018

Package BigVAR. R topics documented: April 3, Type Package

Package datasets.load

Package vinereg. August 10, 2018

Package strat. November 23, 2016

Package GLDreg. February 28, 2017

Package rfsa. R topics documented: January 10, Type Package

Package OLScurve. August 29, 2016

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package gppm. July 5, 2018

Package abe. October 30, 2017

Package CompGLM. April 29, 2018

Package RobustGaSP. R topics documented: September 11, Type Package

Package fastdummies. January 8, 2018

Package MTLR. March 9, 2019

Package libstabler. June 1, 2017

Package freeknotsplines

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package coga. May 8, 2018

Package MixSim. April 29, 2017

Package colf. October 9, 2017

Package ArCo. November 5, 2017

Package validara. October 19, 2017

Package MIICD. May 27, 2017

Package milr. June 8, 2017

Package msgps. February 20, 2015

Package inca. February 13, 2018

Package queuecomputer

Package TANDEM. R topics documented: June 15, Type Package

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package logspline. February 3, 2016

Package frequencyconnectedness

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package TSrepr. January 26, Type Package Title Time Series Representations Version Date

Package fusionclust. September 19, 2017

Package ADMM. May 29, 2018

Package stlplus. August 29, 2016

Package geogrid. August 19, 2018

Package CGP. June 12, 2018

Package ibm. August 29, 2016

Package OptimaRegion

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package svalues. July 15, 2018

Package mfa. R topics documented: July 11, 2018

Package Cubist. December 2, 2017

Package deductive. June 2, 2017

Package gtrendsr. August 4, 2018

Package intccr. September 12, 2017

Package clustering.sc.dp

Package rxylib. December 20, 2017

Package nngeo. September 29, 2018

Package mixphm. July 23, 2015

Package gtrendsr. October 19, 2017

Package bife. May 7, 2017

Package CorporaCoCo. R topics documented: November 23, 2017

Package sure. September 19, 2017

Package fbroc. August 29, 2016

Package areaplot. October 18, 2017

Package spark. July 21, 2017

Package sfc. August 29, 2016

Package beast. March 16, 2018

Package qicharts. October 7, 2014

Package esabcv. May 29, 2015

Package qicharts2. March 3, 2018

Package simr. April 30, 2018

Package smooth. December 23, 2017

Package wrswor. R topics documented: February 2, Type Package

Package weco. May 4, 2018

Package tsfeatures. February 6, 2019

Package survivalmpl. December 11, 2017

Package reghelper. April 8, 2017

The simpleboot Package

Package CausalImpact

Package cgh. R topics documented: February 19, 2015

Package OrthoPanels. November 11, 2016

Package truncreg. R topics documented: August 3, 2016

Package texteffect. November 27, 2017

Package Rspc. July 30, 2018

Package mfbvar. December 28, Type Package Title Mixed-Frequency Bayesian VAR Models Version Date

Package rvinecopulib

Package quickreg. R topics documented:

Package lcc. November 16, 2018

Package FWDselect. December 19, 2015

Package desplot. R topics documented: April 3, 2018

Package readxl. April 18, 2017

Package treedater. R topics documented: May 4, Type Package

Package GFD. January 4, 2018

Package ccapp. March 7, 2016

Package ipft. January 4, 2018

Package simsurv. May 18, 2018

Package knnp. R topics documented: July 1, Version Date

Package uclaboot. June 18, 2003

Package condir. R topics documented: February 15, 2017

Package citools. October 20, 2018

Transcription:

Type Package Package robets March 6, 2018 Title Forecasting Time Series with Robust Exponential Smoothing Version 1.4 Date 2018-03-06 We provide an outlier robust alternative of the function ets() in the 'forecast' package of Hyndman and Khandakar (2008) <DOI:10.18637/jss.v027.i03>. For each method of a class of exponential smoothing variants we made a robust alternative. The class includes methods with a damped trend and/or seasonal components. The robust method is developed by robustifying every aspect of the original exponential smoothing variant. We provide robust forecasting equations, robust initial values, robust smoothing parameter estimation and a robust information criterion. The method is described in more detail in Crevits and Croux (2016) <DOI:10.13140/RG.2.2.11791.18080>. License GPL-3 Depends R (>= 3.1.1) Imports Rcpp (>= 0.12.2), forecast LinkingTo Rcpp LazyData true ByteCompile true BugReports https://github.com/rubencrevits/robets/issues URL http://github.com/rubencrevits/robets RoxygenNote 6.0.1 NeedsCompilation yes Author Ruben Crevits [aut, cre], Christoph Bergmeir [aut], Rob Hyndman [aut], Ross Ihaka [ctb], R Core Team [ctb] Maintainer Ruben Crevits <ruben.crevits@gmail.com> Repository CRAN Date/Publication 2018-03-06 16:46:30 UTC 1

2 forecast.robets R topics documented: coef.robets.......................................... 2 forecast.robets........................................ 2 plot.robets.......................................... 4 plotoutliers......................................... 4 print.robets......................................... 5 robets............................................ 6 summary.robets....................................... 8 tau2............................................. 9 Index 10 coef.robets Coef robets model Coef robets model ## S3 method for class 'robets' coef(object,...) object An object of class robets.... Other undocumented arguments. coef(model) forecast.robets Forecasting using ROBETS models Returns forecasts and other information for univariate ROBETS models. ## S3 method for class 'robets' forecast(object, h = ifelse(object$m > 1, 2 * object$m, 10), level = c(80, 95), PI = TRUE, lambda = object$lambda,...)

forecast.robets 3 object h level PI Details Value An object of class "robets". Usually the result of a call to robets. Number of periods for forecasting Confidence level for prediction intervals. If TRUE, prediction intervals are calculated. lambda Box-Cox transformation parameter. Ignored if NULL. Otherwise, forecasts back-transformed via an inverse Box-Cox transformation.... Other arguments. The code of this function is based on the function forecast.ets of the package forecast of Hyndman and Khandakar (2008). An object of class "forecast". The function summary is used to obtain and print a summary of the results, while the function plot produces a plot of the forecasts. The generic accessor functions fitted.values and residuals extract useful features of the value returned by forecast.robets. An object of class "forecast" is a list containing at least the following elements: Author(s) model: A list containing information about the fitted model method: The name of the forecasting method as a character string mean: Point forecasts as a time series x: The original time series (either object itself or the time series used to create the model stored as object). residuals: Residuals from the fitted model. For models with additive errors, the residuals are x - fitted values. For models with multiplicative errors, the residuals are equal to x /(fitted values) - 1. fitted: Fitted values (one-step ahead forecasts) Ruben Crevits, <ruben.crevits@kuleuven.be>, https://rcrevits.wordpress.com/research 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 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 robets

4 plotoutliers library(forecast) plot(forecast(model)) plot.robets Plot robets model Plot robets model ## S3 method for class 'robets' plot(x,...) x An object of class robets.... Other plotting parameters. See Also plotoutliers, plot.ets plot(model) plotoutliers Plot outliers detected by robets model Plot outliers detected by robets model plotoutliers(object, xlab = "", ylab = "", type = "l",...)

print.robets 5 object An object of class robets. xlab Label of the x-axis. ylab Label of the y-asix. type Character indicating the type of plot, just as in plot.... Other plotting parameters. See Also plot.robets plotoutliers(model) print.robets Print robets model Print robets model ## S3 method for class 'robets' print(x,...) x An object of class robets.... Other undocumented arguments. print(model)

6 robets robets Robust exponential smoothing model 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,...) y model damped alpha beta gamma phi additive.only lambda lower 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)

robets 7 upper opt.crit bounds 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. 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 k nmse 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. 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. Value An object of class "robets". Author(s) Ruben Crevits, <ruben.crevits@kuleuven.be>, https://rcrevits.wordpress.com/research

8 summary.robets 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 library(forecast) plot(forecast(model)) summary.robets Summary robets model Summary robets model ## S3 method for class 'robets' summary(object,...) Value object An object of class robets.... Other undocumented arguments. A number of training set error measures: ME (mean error), RMSE (root mean squared error), MAE (mean absolute error), MPE (mean percentage error), MAPE (mean absolute percentage error), MedianE (median error), RTSE (root tau squared error), RTSPE (root tau squared percentage error). summary(model)

tau2 9 tau2 Compute the tau2 estimator of scale The tau2-estimator is a robust measure of the scale. The exact formula of the estimator is in Crevits and Croux (2016), equation 3.10. tau2(x) x A vector of residuals. Value The tau2 estimate of scale. 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 set.seed(100) e <- 10*rnorm(100) mse <- mean(e^2) tse <- tau2(e)

Index coef.robets, 2 ets, 8 forecast.robets, 2, 8 plot.ets, 4 plot.robets, 4, 5, 8 plotoutliers, 4, 4, 8 print.robets, 5 robets, 3, 6 summary.robets, 8 tau2, 7, 8, 9 10