 Exponential Smoothing Model - Maple Help

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 $t$ is a variable ${y}_{t}$.
 – The level at time $t$ is denoted by ${\mathrm{\ell }}_{t}$.
 – Models with trend have a trend variable, ${b}_{t}$.
 – Models with seasonality have a seasonal variable, ${s}_{t}$.
 – There are errors ${\mathrm{\epsilon }}_{t}$.
 • The variables ${\mathrm{\ell }}_{0}$, ${b}_{0}$, and ${s}_{1-m}$ through ${s}_{0}$, if present, need to be initialized. The number $m$ is the period of the season. In addition there are parameters: $\mathrm{\alpha }$ is always present, $\mathrm{\beta }$ is present in models with trend, $\mathrm{\phi }$ is present in models with a damped trend, and $\mathrm{\gamma }$ is present in models with seasonality.
 • We define the equations defining the variables at time $t$. We start by introducing three auxiliary variables: ${\mathrm{y1}}_{t}$,  ${\mathrm{y2}}_{t}$, and ${\mathrm{y3}}_{t}$.
 – The variable ${\mathrm{y1}}_{t}$ accounts for the trend. It is defined by:

${\mathrm{y1}}_{t}=\left\{\begin{array}{cc}0& \mathrm{trend}=\mathrm{none}\\ {b}_{t-1}& \mathrm{trend}=\mathrm{additive}\\ \mathrm{\phi }{b}_{t-1}& \mathrm{trend}=\mathrm{additivedamped}\\ {b}_{t-1}& \mathrm{trend}=\mathrm{multiplicative}\\ {b}_{t-1}^{\mathrm{\phi }}& \mathrm{trend}=\mathrm{multiplicativedamped}\end{array}$

 – The variable ${\mathrm{y2}}_{t}$ accounts for the previous level and, if applicable, the trend. It is defined by:

${\mathrm{y2}}_{t}=\left\{\begin{array}{cc}{\mathrm{\ell }}_{t-1}& \mathrm{trend}=\mathrm{none}\\ {\mathrm{\ell }}_{t-1}+{\mathrm{y1}}_{t}& \mathrm{trend}=\mathrm{additive}\\ {\mathrm{\ell }}_{t-1}+{\mathrm{y1}}_{t}& \mathrm{trend}=\mathrm{additivedamped}\\ {\mathrm{\ell }}_{t-1}{\mathrm{y1}}_{t}& \mathrm{trend}=\mathrm{multiplicative}\\ {\mathrm{\ell }}_{t-1}{\mathrm{y1}}_{t}& \mathrm{trend}=\mathrm{multiplicativedamped}\end{array}$

 – The variable ${\mathrm{y3}}_{t}$ is like ${\mathrm{y2}}_{t}$, except it also accounts for seasonal effects. (This is essentially the forecast for the output at $t$.) It is defined by:

${\mathrm{y3}}_{t}=\left\{\begin{array}{cc}{\mathrm{y2}}_{t}& \mathrm{seasonal}=\mathrm{none}\\ {\mathrm{y2}}_{t}+{s}_{t-m}& \mathrm{seasonal}=\mathrm{additive}\\ {\mathrm{y2}}_{t}{s}_{t-m}& \mathrm{seasonal}=\mathrm{multiplicative}\end{array}$

 – Now ${y}_{t}$ can be defined as follows:

${y}_{t}=\left\{\begin{array}{cc}{\mathrm{y3}}_{t}+{\mathrm{ϵ}}_{t}& \mathrm{errors}=\mathrm{additive}\\ {\mathrm{y3}}_{t}\left(1+{\mathrm{ϵ}}_{t}\right)& \mathrm{errors}=\mathrm{multiplicative}\end{array}$

 – The level ${\mathrm{\ell }}_{t}$ can be computed in the following manner:

${\mathrm{\ell }}_{t}=\left\{\begin{array}{cc}\left\{\begin{array}{cc}{\mathrm{y2}}_{t}+\frac{\mathrm{\alpha }{\mathrm{ϵ}}_{t}}{{s}_{t-m}}& \mathrm{seasonal}=\mathrm{multiplicative}\\ \mathrm{\alpha }{\mathrm{ϵ}}_{t}+{\mathrm{y2}}_{t}& \mathrm{otherwise}\end{array}& \mathrm{errors}=\mathrm{additive}\\ \left\{\begin{array}{cc}{\mathrm{y2}}_{t}+\mathrm{\alpha }\left({\mathrm{y2}}_{t}+{s}_{t-m}\right){\mathrm{ϵ}}_{t}& \mathrm{seasonal}=\mathrm{additive}\\ {\mathrm{y2}}_{t}\left(\mathrm{\alpha }{\mathrm{ϵ}}_{t}+1\right)& \mathrm{otherwise}\end{array}& \mathrm{errors}=\mathrm{multiplicative}\end{array}$

 – For models with trend, we define ${b}_{t}$ as follows.

${b}_{t}=\left\{\begin{array}{cc}{\mathrm{y1}}_{t}+\frac{\mathrm{\beta }{\mathrm{ϵ}}_{t}}{\left(\left\{\begin{array}{cc}{s}_{t-m}& \mathrm{seasonal}=\mathrm{multiplicative}\\ 1& \mathrm{otherwise}\end{array}\right)\left(\left\{\begin{array}{cc}{\mathrm{\ell }}_{t-1}& \mathrm{trend}\in \left\{\mathrm{multiplicative},\mathrm{multiplicativedamped}\right\}\\ 1& \mathrm{otherwise}\end{array}\right)}& \mathrm{errors}=\mathrm{additive}\\ \left\{\begin{array}{cc}{\mathrm{y1}}_{t}+\mathrm{\beta }\left({\mathrm{y1}}_{t}+{\mathrm{\ell }}_{t-1}+\left(\left\{\begin{array}{cc}{s}_{t-m}& \mathrm{seasonal}=\mathrm{additive}\\ 0& \mathrm{otherwise}\end{array}\right)\right){\mathrm{ϵ}}_{t}& \mathrm{trend}\in \left\{\mathrm{additive},\mathrm{additivedamped}\right\}\\ \left\{\begin{array}{cc}{\mathrm{y1}}_{t}+\mathrm{\beta }\left({\mathrm{y1}}_{t}+\frac{{s}_{t-m}}{{\mathrm{\ell }}_{t-1}}\right){\mathrm{ϵ}}_{t}& \mathrm{seasonal}=\mathrm{additive}\\ {\mathrm{y1}}_{t}\left(\mathrm{\beta }{\mathrm{ϵ}}_{t}+1\right)& \mathrm{otherwise}\end{array}& \mathrm{trend}\in \left\{\mathrm{multiplicative},\mathrm{multiplicativedamped}\right\}\end{array}& \mathrm{errors}=\mathrm{multiplicative}\end{array}$

 – For models with seasonal influence, we define ${s}_{t}$ as follows.

${s}_{t}=\left\{\begin{array}{cc}\left\{\begin{array}{cc}\mathrm{\gamma }{\mathrm{ϵ}}_{t}+{s}_{t-m}& \mathrm{seasonal}=\mathrm{additive}\\ {s}_{t-m}+\frac{\mathrm{\gamma }{\mathrm{ϵ}}_{t}}{{\mathrm{y2}}_{t}}& \mathrm{seasonal}=\mathrm{multiplicative}\end{array}& \mathrm{errors}=\mathrm{additive}\\ \left\{\begin{array}{cc}{s}_{t-m}+\mathrm{\gamma }\left({\mathrm{y2}}_{t}+{s}_{t-m}\right){\mathrm{ϵ}}_{t}& \mathrm{seasonal}=\mathrm{additive}\\ {s}_{t-m}\left(\mathrm{\gamma }{\mathrm{ϵ}}_{t}+1\right)& \mathrm{seasonal}=\mathrm{multiplicative}\end{array}& \mathrm{errors}=\mathrm{multiplicative}\end{array}$ Options

 The following options can be specified:
 • errors, trend, seasonal : string or name or set of strings or names
 Discussed in the section on model variants.
 • 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 $m$ 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.
 • l0, b0 : numeric
 Fixes the value of the given initial value, ${\mathrm{\ell }}_{0}$ or ${b}_{0}$, respectively; they are the initial values for ${\mathrm{\ell }}_{t}$ and ${b}_{t}$, discussed in the section on model equations. If not specified, the initial values are subject to optimization when Optimize is called.
 • s : list or Vector with numeric entries
 Initial values for the seasonal parameter $s$. There are $m$ values, one for each period. They correspond to the values ${s}_{1-m}$, ..., ${s}_{0}$, and they need to occur in that order in the list or Vector. If not specified, these values are subject to optimization when Optimize is called.
 • sigma : numeric
 The standard deviation of the normal random variable that supplies the errors, ${\mathrm{\epsilon }}_{t}$ 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
 There are traditional constraints on the parameters $\mathrm{\alpha }$, $\mathrm{\beta }$, $\mathrm{\gamma }$, and $\mathrm{\phi }$ that allow for the model to be interpreted in the framework of exponential smoothing. These are called the "usual" constraints. There are also constraints (typically, but not always, less strict) that need to be satisfied for the model to be numerically stable, or "admissible". The constraints option selects which constraints are used: constraints = usual uses only the usual constraints, constraints = admissible uses only the constraints for an admissible model, and constraints = both (the default) uses both sets of constraints.
 • criterion : procedure
 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 two-letter strings (a suitable subset of $\left\{"A","Ad","M","Md","N"\right\}$) alpha, beta, gamma, phi, l0, b0, sigma algebraic constant period positive integer s Vector with rtable options given by datatype = float 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 $1$. Examples

 > $\mathrm{with}\left(\mathrm{TimeSeriesAnalysis}\right):$

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

 > $\mathrm{ts}≔\mathrm{TimeSeries}\left(⟨41.7,24.0,32.3,37.3,46.2,29.3,36.5,43.0,48.9,31.2,37.7,40.4,51.2,31.9,41.0,43.8,55.6,33.9,42.1,45.6,59.8,35.2,44.3,47.9⟩,\mathrm{startdate}="2005",\mathrm{frequency}=\mathrm{quarterly},\mathrm{header}="Visitor nights"\right)$
 ${\mathrm{ts}}{≔}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{Visitor nights}}\\ {\mathrm{24 rows of data:}}\\ {\mathrm{2005-Jan-01 - 2010-Oct-01}}\end{array}\right]$ (1)

We fit an exponential smoothing model to it.

 > $\mathrm{esm}≔\mathrm{ExponentialSmoothingModel}\left(\mathrm{ts}\right)$
 ${\mathrm{TimeSeriesAnalysis}}{:-}{\mathrm{ExponentialSmoothingModel}}{}\left({\mathrm{errors}}{=}\left\{{"M"}\right\}{,}{\mathrm{trend}}{=}\left\{{"A"}\right\}{,}{\mathrm{seasonal}}{=}\left\{{"M"}\right\}{,}{\mathrm{α}}{=}{0.4836790988889591}{,}{\mathrm{β}}{=}{0.0003088251694408857}{,}{\mathrm{γ}}{=}{0.00023143579040411943}{,}{\mathrm{φ}}{=}{1.}{,}{\mathrm{period}}{=}{4}{,}{\mathrm{l0}}{=}{31.691916154639692}{,}{\mathrm{b0}}{=}{0.6527296503176275}{,}{s}{=}\left(\left[\begin{array}{c}1.2641437853861655\\ 0.7602113492955748\\ 0.946057915985054\\ 1.0295918919494698\end{array}\right]\right){,}{\mathrm{σ}}{=}{0.03343189749472918}{,}{\mathrm{constraints}}{=}{"both"}\right)$ (2)

To evaluate the fit of this model, view the one step forecasts.

 > $\mathrm{onestepfcs}≔\mathrm{OneStepForecasts}\left(\mathrm{esm},\mathrm{ts}\right)$
 ${\mathrm{onestepfcs}}{≔}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{Visitor nights \left(1 step forecasts\right)}}\\ {\mathrm{24 rows of data:}}\\ {\mathrm{2005-Jan-01 - 2010-Oct-01}}\end{array}\right]$ (3)
 > $\mathrm{TimeSeriesPlot}\left(\left[\mathrm{onestepfcs},\mathrm{color}="Spring Blue",\mathrm{thickness}=2\right],\left[\mathrm{ts},\mathrm{color}="Spring Rose",\mathrm{thickness}=4\right]\right)$ Let's add 80% and 95% confidence intervals.

 > $\mathrm{onestepconf}≔\mathrm{OneStepForecasts}\left(\mathrm{esm},\mathrm{ts},\mathrm{output}=\mathrm{percentiles}\left(2.5,10,90,97.5\right)\right)$
 ${\mathrm{onestepconf}}{≔}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{Visitor nights \left(1 step forecast - 2 percentile\right), ..., Visitor nights \left(1 step forecast - 98 percentile\right)}}\\ {\mathrm{24 rows of data:}}\\ {\mathrm{2005-Jan-01 - 2010-Oct-01}}\end{array}\right]$ (4)
 > $\mathrm{TimeSeriesPlot}\left(\left[\mathrm{onestepfcs},\mathrm{color}="Spring Blue",\mathrm{thickness}=2\right],\left[\mathrm{onestepconf},\mathrm{color}="Spring YellowGreen".."Spring BlueGreen"\right],\left[\mathrm{ts},\mathrm{color}="Spring Rose",\mathrm{thickness}=4\right]\right)$ The fit looks pretty good. Now let us add the forecasts.

 > $\mathrm{fcs}≔\mathrm{Forecast}\left(\mathrm{esm},\mathrm{ts},8\right)$
 ${\mathrm{fcs}}{≔}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{Visitor nights \left(forecast\right)}}\\ {\mathrm{8 rows of data:}}\\ {\mathrm{2010-Dec-31 - 2012-Sep-30}}\end{array}\right]$ (5)
 > $\mathrm{conf}≔\mathrm{Forecast}\left(\mathrm{esm},\mathrm{ts},8,\mathrm{output}=\mathrm{percentiles}\left(2.5,10,90,97.5\right)\right)$
 ${\mathrm{conf}}{≔}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{Visitor nights \left(forecast - 2 percentile\right), ..., Visitor nights \left(forecast - 98 percentile\right)}}\\ {\mathrm{8 rows of data:}}\\ {\mathrm{2010-Dec-31 - 2012-Sep-30}}\end{array}\right]$ (6)
 > $\mathrm{TimeSeriesPlot}\left(\left[\mathrm{onestepfcs},\mathrm{color}="Spring Blue",\mathrm{thickness}=2\right],\left[\mathrm{onestepconf},\mathrm{color}="Spring YellowGreen".."Spring BlueGreen"\right],\left[\mathrm{fcs},\mathrm{color}="Spring Blue",\mathrm{thickness}=2,\mathrm{legend}=""\right],\left[\mathrm{conf},\mathrm{color}="Spring YellowGreen".."Spring BlueGreen",\mathrm{legend}=""\right],\left[\mathrm{ts},\mathrm{color}="Spring Rose",\mathrm{thickness}=4\right]\right)$ 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.

 > $\mathrm{esm2}≔\mathrm{ExponentialSmoothingModel}\left(\mathrm{seasonal}=\left\{A,M\right\},\mathrm{constraints}=\mathrm{admissible}\right)$
 ${\mathrm{TimeSeriesAnalysis}}{:-}{\mathrm{ExponentialSmoothingModel}}{}\left({\mathrm{errors}}{=}\left\{{"A"}{,}{"M"}\right\}{,}{\mathrm{trend}}{=}\left\{{"A"}{,}{"Ad"}{,}{"M"}{,}{"Md"}{,}{"N"}\right\}{,}{\mathrm{seasonal}}{=}\left\{{"A"}{,}{"M"}\right\}{,}{\mathrm{constraints}}{=}{"admissible"}\right)$ (7)

Transform to a collection of specialized models.

 > $\mathrm{models}≔\mathrm{Specialize}\left(\mathrm{esm2},\mathrm{ts}\right)$
 ${\mathrm{models}}{≔}\left[{\mathrm{< an ETS\left(A,A,A\right) model >}}{,}{\mathrm{< an ETS\left(A,Ad,A\right) model >}}{,}{\mathrm{< an ETS\left(A,N,A\right) model >}}{,}{\mathrm{< an ETS\left(M,A,A\right) model >}}{,}{\mathrm{< an ETS\left(M,A,M\right) model >}}{,}{\mathrm{< an ETS\left(M,Ad,A\right) model >}}{,}{\mathrm{< an ETS\left(M,Ad,M\right) model >}}{,}{\mathrm{< an ETS\left(M,M,M\right) model >}}{,}{\mathrm{< an ETS\left(M,Md,M\right) model >}}{,}{\mathrm{< an ETS\left(M,N,A\right) model >}}{,}{\mathrm{< an ETS\left(M,N,M\right) model >}}\right]$ (8)

Find initial points for optimization for all of these.

 > $\mathrm{inits}≔\mathrm{map}\left(\mathrm{Initialize},\mathrm{models},\mathrm{ts}\right):$

Optimize all of them.

 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}i\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{numelems}\left(\mathrm{models}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{Optimize}\left({\mathrm{models}}_{i},\mathrm{ts},{\mathrm{inits}}_{i}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end do}:$

Evaluate the Bayesian information criterion for each model.

 > $\mathrm{map}\left(\mathrm{model}→\mathrm{print}\left(\mathrm{model},\mathrm{BIC}\left(\mathrm{model},\mathrm{ts}\right)\right),\mathrm{models}\right):$
 ${\mathrm{< an ETS\left(A,A,A\right) model >}}{,}{126.7819508}$
 ${\mathrm{< an ETS\left(A,Ad,A\right) model >}}{,}{126.9258852}$
 ${\mathrm{< an ETS\left(A,N,A\right) model >}}{,}{129.9242821}$
 ${\mathrm{< an ETS\left(M,A,A\right) model >}}{,}{141.6667862}$
 ${\mathrm{< an ETS\left(M,A,M\right) model >}}{,}{109.4702551}$
 ${\mathrm{< an ETS\left(M,Ad,A\right) model >}}{,}{135.7502647}$
 ${\mathrm{< an ETS\left(M,Ad,M\right) model >}}{,}{109.9821406}$
 ${\mathrm{< an ETS\left(M,M,M\right) model >}}{,}{111.2692148}$
 ${\mathrm{< an ETS\left(M,Md,M\right) model >}}{,}{109.4060877}$
 ${\mathrm{< an ETS\left(M,N,A\right) model >}}{,}{140.6230023}$
 ${\mathrm{< an ETS\left(M,N,M\right) model >}}{,}{112.5756460}$ (9)

Compare all models' fits.

 > $\mathrm{colors}≔\mathrm{ColorTools}:-\mathrm{Gradient}\left("Niagara Navy".."Niagara Purple",\mathrm{number}=\mathrm{numelems}\left(\mathrm{models}\right)\right)$
 $\left[{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ColorTools}}{:-}{\mathrm{Color}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{object}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{colorspace}}{,}{\mathrm{coordinates}}{,}{\mathrm{color_caption}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right]$ (10)
 > $\mathrm{TimeSeriesPlot}\left(\mathrm{seq}\left(\left[\mathrm{OneStepForecasts}\left({\mathrm{models}}_{i},\mathrm{ts}\right),\mathrm{color}=\mathrm{ToPlotColor}\left({\mathrm{colors}}_{i}\right),\mathrm{legend}='\mathrm{print_preprocess}'\left({\mathrm{models}}_{i}\right)\right],i=1..\mathrm{numelems}\left(\mathrm{models}\right)\right),\left[\mathrm{ts},\mathrm{color}="Niagara Green",\mathrm{thickness}=3\right]\right)$ 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 $\mathrm{\alpha }$ is equal to $\frac{1}{10}$ and $\mathrm{\phi }$, if present in the model, is equal to $0.95$.

 > $\mathrm{esm3}≔\mathrm{ExponentialSmoothingModel}\left(\mathrm{ts},A,\left\{A,\mathrm{Ad}\right\},\left\{A,M\right\},\mathrm{α}=\frac{1}{10},\mathrm{φ}=0.95\right)$
 ${\mathrm{TimeSeriesAnalysis}}{:-}{\mathrm{ExponentialSmoothingModel}}{}\left({\mathrm{errors}}{=}\left\{{"A"}\right\}{,}{\mathrm{trend}}{=}\left\{{"A"}\right\}{,}{\mathrm{seasonal}}{=}\left\{{"A"}\right\}{,}{\mathrm{α}}{=}\frac{{1}}{{10}}{,}{\mathrm{β}}{=}{0.0002677837116860021}{,}{\mathrm{γ}}{=}{0.0000013845721329026309}{,}{\mathrm{φ}}{=}{1.}{,}{\mathrm{period}}{=}{4}{,}{\mathrm{l0}}{=}{33.474612777225495}{,}{\mathrm{b0}}{=}{0.5867884759845841}{,}{s}{=}\left(\left[\begin{array}{c}10.57209848493659\\ -9.738941833278929\\ -2.0474978677044824\\ 1.214341354558895\end{array}\right]\right){,}{\mathrm{σ}}{=}{1.546317538969885}{,}{\mathrm{constraints}}{=}{"both"}\right)$ (11)

The optimized model is in this case not a damped model. So $\mathrm{\phi }$ is not part of this model, and therefore its value is set to the default - $1$. The setting of $\mathrm{\alpha }$ we required is respected.

 > $\mathrm{GetParameter}\left(\mathrm{esm3},\left[\mathrm{α},\mathrm{φ}\right]\right)$
 $\left[\frac{{1}}{{10}}{,}{1.}\right]$ (12)

A plot of data and forecasts:

 > $\mathrm{TimeSeriesPlot}\left(\left[\mathrm{ts},\mathrm{color}="Niagara Green"\right],\mathrm{OneStepForecasts}\left(\mathrm{esm3},\mathrm{ts}\right),\left[\mathrm{Forecast}\left(\mathrm{esm3},\mathrm{ts},8,\mathrm{output}=\mathrm{percentiles}\left(2.5,10,50,90,97.5\right)\right)\right]\right)$  References

 Hyndman, R.J. and Athanasopoulos, G. (2013) Forecasting: principles and practice. http://otexts.org/fpp/. Accessed on 2013-10-09.
 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. Springer-Verlag Berlin Heidelberg. Compatibility

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