Forecasts of STL objects are obtained by applying a non-seasonal forecasting
model to the seasonally adjusted data and re-seasonalizing using the last
year of the seasonal component. stlm takes a time series y, applies an STL decomposition, and
models the seasonally adjusted data using the model passed as
modelfunction or specified using method. It returns an object
that includes the original STL decomposition and a time series model fitted
to the seasonally adjusted data. This object can be passed to the
forecast.stlm for forecasting.
Arguments
- y
a numeric vector or univariate time series of class
ts- s.window
Either the character string
"periodic"or the span (in lags) of the loess window for seasonal extraction.- t.window
A number to control the smoothness of the trend. See
stats::stl()for details.- robust
If
TRUE, robust fitting will used in the loess procedure withinstats::stl().- method
Method to use for forecasting the seasonally adjusted series.
- modelfunction
An alternative way of specifying the function for modelling the seasonally adjusted series. If
modelfunctionis notNULL, thenmethodis ignored. Otherwisemethodis used to specify the time series model to be used.- model
Output from a previous call to
stlm. If astlmmodel is passed, this same model is fitted to y without re-estimating any parameters.- etsmodel
The ets model specification passed to
ets(). By default it allows any non-seasonal model. Ifmethod != "ets", this argument is ignored.- lambda
Box-Cox transformation parameter. If
lambda = "auto", then a transformation is automatically selected usingBoxCox.lambda. The transformation is ignored if NULL. Otherwise, data transformed before model is estimated.- biasadj
Use adjusted back-transformed mean for Box-Cox transformations. If transformed data is used to produce forecasts and fitted values, a regular back transformation will result in median forecasts. If biasadj is
TRUE, an adjustment will be made to produce mean forecasts and fitted values.- xreg
Historical regressors to be used in
auto.arima()whenmethod = "arima".- allow.multiplicative.trend
If
TRUE, then ETS models with multiplicative trends are allowed. Otherwise, only additive or no trend ETS models are permitted.- x
Deprecated. Included for backwards compatibility.
- ...
Other arguments passed to
modelfunction.
Details
The time series model for the seasonally adjusted data can be specified in
stlm using either method or modelfunction. The
method argument provides a shorthand way of specifying
modelfunction for a few special cases. More generally,
modelfunction can be any function with first argument a ts
object, that returns an object that can be passed to forecast().
For example, modelfunction = ar uses the ar() function
for modelling the seasonally adjusted series.


