1% Generated by roxygen2: do not edit by hand 2% Please edit documentation in R/ets.R 3\name{ets} 4\alias{ets} 5\alias{print.ets} 6\alias{summary.ets} 7\alias{as.character.ets} 8\alias{coef.ets} 9\alias{tsdiag.ets} 10\title{Exponential smoothing state space model} 11\usage{ 12ets( 13 y, 14 model = "ZZZ", 15 damped = NULL, 16 alpha = NULL, 17 beta = NULL, 18 gamma = NULL, 19 phi = NULL, 20 additive.only = FALSE, 21 lambda = NULL, 22 biasadj = FALSE, 23 lower = c(rep(1e-04, 3), 0.8), 24 upper = c(rep(0.9999, 3), 0.98), 25 opt.crit = c("lik", "amse", "mse", "sigma", "mae"), 26 nmse = 3, 27 bounds = c("both", "usual", "admissible"), 28 ic = c("aicc", "aic", "bic"), 29 restrict = TRUE, 30 allow.multiplicative.trend = FALSE, 31 use.initial.values = FALSE, 32 na.action = c("na.contiguous", "na.interp", "na.fail"), 33 ... 34) 35} 36\arguments{ 37\item{y}{a numeric vector or time series of class \code{ts}} 38 39\item{model}{Usually a three-character string identifying method using the 40framework terminology of Hyndman et al. (2002) and Hyndman et al. (2008). 41The first letter denotes the error type ("A", "M" or "Z"); the second letter 42denotes the trend type ("N","A","M" or "Z"); and the third letter denotes 43the season type ("N","A","M" or "Z"). In all cases, "N"=none, "A"=additive, 44"M"=multiplicative and "Z"=automatically selected. So, for example, "ANN" is 45simple exponential smoothing with additive errors, "MAM" is multiplicative 46Holt-Winters' method with multiplicative errors, and so on. 47 48It is also possible for the model to be of class \code{"ets"}, and equal to 49the output from a previous call to \code{ets}. In this case, the same model 50is fitted to \code{y} without re-estimating any smoothing parameters. See 51also the \code{use.initial.values} argument.} 52 53\item{damped}{If TRUE, use a damped trend (either additive or 54multiplicative). If NULL, both damped and non-damped trends will be tried 55and the best model (according to the information criterion \code{ic}) 56returned.} 57 58\item{alpha}{Value of alpha. If NULL, it is estimated.} 59 60\item{beta}{Value of beta. If NULL, it is estimated.} 61 62\item{gamma}{Value of gamma. If NULL, it is estimated.} 63 64\item{phi}{Value of phi. If NULL, it is estimated.} 65 66\item{additive.only}{If TRUE, will only consider additive models. Default is 67FALSE.} 68 69\item{lambda}{Box-Cox transformation parameter. If \code{lambda="auto"}, 70then a transformation is automatically selected using \code{BoxCox.lambda}. 71The transformation is ignored if NULL. Otherwise, 72data transformed before model is estimated. When \code{lambda} is specified, 73\code{additive.only} is set to \code{TRUE}.} 74 75\item{biasadj}{Use adjusted back-transformed mean for Box-Cox 76transformations. If transformed data is used to produce forecasts and fitted values, 77a regular back transformation will result in median forecasts. If biasadj is TRUE, 78an adjustment will be made to produce mean forecasts and fitted values.} 79 80\item{lower}{Lower bounds for the parameters (alpha, beta, gamma, phi)} 81 82\item{upper}{Upper bounds for the parameters (alpha, beta, gamma, phi)} 83 84\item{opt.crit}{Optimization criterion. One of "mse" (Mean Square Error), 85"amse" (Average MSE over first \code{nmse} forecast horizons), "sigma" 86(Standard deviation of residuals), "mae" (Mean of absolute residuals), or 87"lik" (Log-likelihood, the default).} 88 89\item{nmse}{Number of steps for average multistep MSE (1<=\code{nmse}<=30).} 90 91\item{bounds}{Type of parameter space to impose: \code{"usual" } indicates 92all parameters must lie between specified lower and upper bounds; 93\code{"admissible"} indicates parameters must lie in the admissible space; 94\code{"both"} (default) takes the intersection of these regions.} 95 96\item{ic}{Information criterion to be used in model selection.} 97 98\item{restrict}{If \code{TRUE} (default), the models with infinite variance 99will not be allowed.} 100 101\item{allow.multiplicative.trend}{If \code{TRUE}, models with multiplicative 102trend are allowed when searching for a model. Otherwise, the model space 103excludes them. This argument is ignored if a multiplicative trend model is 104explicitly requested (e.g., using \code{model="MMN"}).} 105 106\item{use.initial.values}{If \code{TRUE} and \code{model} is of class 107\code{"ets"}, then the initial values in the model are also not 108re-estimated.} 109 110\item{na.action}{A function which indicates what should happen when the data 111contains NA values. By default, the largest contiguous portion of the 112time-series will be used.} 113 114\item{...}{Other undocumented arguments.} 115} 116\value{ 117An object of class "\code{ets}". 118 119The generic accessor functions \code{fitted.values} and \code{residuals} 120extract useful features of the value returned by \code{ets} and associated 121functions. 122} 123\description{ 124Returns ets model applied to \code{y}. 125} 126\details{ 127Based on the classification of methods as described in Hyndman et al (2008). 128 129The methodology is fully automatic. The only required argument for ets is 130the time series. The model is chosen automatically if not specified. This 131methodology performed extremely well on the M3-competition data. (See 132Hyndman, et al, 2002, below.) 133} 134\examples{ 135fit <- ets(USAccDeaths) 136plot(forecast(fit)) 137 138} 139\references{ 140Hyndman, R.J., Koehler, A.B., Snyder, R.D., and Grose, S. (2002) 141"A state space framework for automatic forecasting using exponential 142smoothing methods", \emph{International J. Forecasting}, \bold{18}(3), 143439--454. 144 145Hyndman, R.J., Akram, Md., and Archibald, B. (2008) "The admissible 146parameter space for exponential smoothing models". \emph{Annals of 147Statistical Mathematics}, \bold{60}(2), 407--426. 148 149Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) 150\emph{Forecasting with exponential smoothing: the state space approach}, 151Springer-Verlag. \url{http://www.exponentialsmoothing.net}. 152} 153\seealso{ 154\code{\link[stats]{HoltWinters}}, \code{\link{rwf}}, 155\code{\link{Arima}}. 156} 157\author{ 158Rob J Hyndman 159} 160\keyword{ts} 161