TimeSeriesAnalysis[ExponentialSmoothingModel]  exponential smoothing model

Calling Sequence


ExponentialSmoothingModel(ts, E, T, S, opts)


Parameters


ts



(optional) Time series consisting of a single data set

E



(optional) types of error allowed (name, string, or set of these)

T



(optional) types of trend allowed (name, string, or set of these)

S



(optional) types of seasonal influence allowed (name, string, or set of these)

opts



(optional) equations of the form optionname = value to set other parameters





Description


•

The ExponentialSmoothingModel command creates an exponential smoothing model or ETS model for a time series. These models are a generalization of the idea to use exponential smoothing of the previous data as a forecast. The model can get its parameters optimized automatically to fit a given time series, or the parameters can be set by hand.



Model variants


•

There are 30 variants of this model. They are distinguished by:

–

whether errors are additive or multiplicative;

–

whether there is a trend, and if there is one, if it is additive or multiplicative and whether it is damped or not;

–

whether there is seasonal influence, and if there is, whether it is additive or multiplicative.

•

By default, Maple creates a model that potentially represents any of the 30 variants. Maple can automatically select one that is appropriate for a time series, or you can restrict the selection manually.

•

Restricting the selection manually can be done with the E, T, and S parameters, or by using the named options errors, trend, and seasonal. If using E, T, and S, one needs to supply all three parameters; using the named options, one can use any subset. The values are given by the following table.

Value (long)

Value(short)

errors / E

trend / T

seasonal / S

none

N



+

+

additive

A

+

+

+

additivedamped

Ad



+



multiplicative

M

+

+

+

multiplicativedamped

Md



+





•

For example, the third row of this table says that only the trend or T parameter can be additive damped, not the errors or seasonal parameter. These values are supplied either in short or long form and can be either a string or a name. If a single value is desired, then one can use the corresponding string or name by itself; otherwise a set must be given. For example, you could specify errors = "A" to consider only models with additive error, or seasonal = {"additive", "M"} to consider models with additive or multiplicative seasonality (but not models without seasonal influence).

•

The option damping = false will exclude the models with damped trend from being considered.

•

Some of these models lead to numerical difficulties. These are not considered by default. For more details, see the Specialize help page.



Typical usage


•

If you supply a time series to the ExponentialSmoothingModel command, Maple will compute the most suitable model for that time series. If you do not supply a time series to ExponentialSmoothingModel, you can perform the steps involved by hand, otherwise they happen behind the scenes:

–

First, use the Specialize command. This command, and all of the following, do require a time series argument. It returns a list of models of all variants that are suitable for the time series and compatible with the given options.

–

Then, use the Initialize command. This command finds and records initial values for the optimization procedure run next.

–

The Optimize command subsequently optimizes the parameters and initial values  starting from the values generated by the Initialize command.

–

Finally, to select which model is the most suitable, compare the LogLikelihood and the NumberOfParameters of each candidate. Standard ways to do this are to use one of the AICc, AIC, and BIC commands to compute the corresponding information criteria, and select the model where the value is lowest. If you supply a time series to the original ExponentialSmoothingModel command, the AICc command is used.

•

Once the model has been generated, either fully automatically or by hand, you can use the OneStepForecasts command to see if the fit is good enough for your purposes, and then Forecast to get a forecast of future values. Both of these can include confidence intervals (obtained through simulation).



Model equations


•

We present the equations for all variants of the model in innovation state space form.

•

The equations for the models can be given in terms of these variables:

–

The actual output at time is a variable .

–

The level at time is denoted by .

–

Models with trend have a trend variable, .

–

Models with seasonality have a seasonal variable, .

–

There are errors .

–

The variable accounts for the trend. It is defined by:

–

The variable accounts for the previous level and, if applicable, the trend. It is defined by:

–

Now can be defined as follows:

–

The level can be computed in the following manner:

–

For models with trend, we define as follows.

–

For models with seasonal influence, we define as follows.



Options



The following options can be specified:

•

errors, trend, seasonal : string or name or set of strings or names

•

alpha, beta, gamma, phi : numeric


Fixes the value of the given parameter, discussed in the section on model equations. This means that these parameters won't be subject to optimization when Optimize is called.

•

period : positive integer


Sets the period of the season. If it is not specified explicitly, the period is taken from the time series supplied during the Optimize call. A value of 1 disables the use of model variants with seasonal influence. Exponential smoothing models are most effective when the period is at most 12; an error will be given for periods greater than 24.

•

s : list or Vector with numeric entries


The standard deviation of the normal random variable that supplies the errors, in the section on model equations. If not specified explicitly, its value is taken from the errors in the time series supplied to Optimize.

•

damping : true or false


If damping = false is included as an option, then models with damped trend will not be considered. The default is damping = true.

•

constraints : equal to usual, admissible, or both


By default, as explained in the section on typical usage, Maple uses Akaike's information criterion with the sample size correction, AICc, to select the best model. If you supply the criterion option, you can choose a different criterion. Typical choices would be AIC or BIC, but you can also supply a different procedure. This procedure will be passed three arguments: the model, the time series, and the argument loglikelihood = ll, where ll is the precomputed log likelihood. The procedure should return a number. Maple selects the model where the returned value is the lowest.



Working With Model Parameters


•

The exponential smoothing model constructed by this command has parameters that can be examined and set using the GetParameter, GetParameters, and SetParameter commands. These correspond loosely to the named options above, but they are generally less flexible. The parameters are detailed below, with a description of what are legal values for the parameter. When using SetParameter, you need to make sure that the new value conforms with these restrictions.

Parameters

Legal values

errors, trend, seasonal

set of one or twoletter strings (a suitable subset of )

alpha, beta, gamma, phi, l0, b0, sigma

algebraic constant

period

positive integer

s

Vector with rtable options given by datatype = float[8] and storage = rectangular, and no indexing functions

constraints

string, in particular one of "usual", "admissible", or "both"



•

There is no damping parameter  that information is encoded in the errors, trend, and seasonal parameters. There is also no criterion parameter: that information is only used when a time series is included in the ExponentialSmoothingModel calling sequence.

•

If there is no seasonality, the value of period is .



Compatibility


•

The TimeSeriesAnalysis[ExponentialSmoothingModel] command was introduced in Maple 18.



Examples


>


Consider the following time series. It represents international tourist visitor nights in Australia.
>


 (1) 
We fit an exponential smoothing model to it.
>


 (2) 
To evaluate the fit of this model, view the one step forecasts.
>


 (3) 
>


Let's add 80% and 95% confidence intervals.
>


 (4) 
>


The fit looks pretty good. Now let us add the forecasts.
>


 (5) 
>


 (6) 
>


Doing this by hand, we could go about this as follows. We see that the seasonal influence is very significant; a model that doesn't take that into account is not likely to do well. We will also relax the constraints to allow all admissible parameter values.
>


 (7) 
Transform to a collection of specialized models.
>


 (8) 
Find initial points for optimization for all of these.
>


Optimize all of them.
>


Evaluate the Bayesian information criterion for each model.
>


 (9) 
Compare all models' fits.
>


 (10) 
>


In the following example, let's assume we know beforehand that we want a model with additive errors, a trend that is either additive or additive damped, and additive or multiplicative seasonality. Additionally, we know that is equal to and , if present in the model, is equal to .
>


 (11) 
The optimized model is in this case not a damped model. So is not part of this model, and therefore its value is set to the default  . The setting of we required is respected.
>


 (12) 
A plot of data and forecasts:
>


>




References



Hyndman, R.J. and Athanasopoulos, G. (2013) Forecasting: principles and practice. http://otexts.org/fpp/. Accessed on 20131009.


Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with Exponential Smoothing: The State Space Approach. Springer Series in Statistics. SpringerVerlag Berlin Heidelberg.


