TimeSeriesAnalysis - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : Time Series Analysis Package : TimeSeriesAnalysis/GetParameter

TimeSeriesAnalysis

 GetParameter
 get the value of one or more parameters of a model
 GetParameters
 get the value of all parameters of a model
 SetParameter
 set the value of a parameter of a model

 Calling Sequence GetParameter(model, param) GetParameter(model, params) GetParameters(model, opt) SetParameter(model, param, value) SetParameter(model, param = value)

Parameters

 model - param - parameter name params - list of parameter names opt - (optional) equation of the form output = o, where o is one of all, assigned, unassigned value - new value for the parameter

Description

 • These three commands work with all parameters of a model, not just the ones that are subject to optimization. This is in contrast with NumberOfParameters, which works only with parameters that can be optimized in a continuous domain.
 • The command GetParameter can be used to examine the value of one or a few named parameters of a model. If the second argument is the name of a parameter, it returns the value of that parameter. If it is a list of parameter names, it returns the corresponding list of values.
 • The command GetParameters can be used to examine the value of all parameters of a model, without knowing their names. It can also be used to find all assigned or unassigned parameters. This is decided by the use of the output option. Its default value is all, which means to return all parameters. In particular, it returns a list consisting of the names of all unassigned parameters, and equations of the form name = value for all assigned parameters. If the argument output = assigned is specified, then a list with only the equations is returned. If output = unassigned is specified, then a list with only the names is returned.
 • The command SetParameter can be used to set the value of a parameter of a model. The two calling sequences are equivalent. If a parameter is set already, and SetParameter is used to set it to a different value, then it will issue a warning.
 • Setting some parameters may set other parameters as well. For example, with exponential smoothing models, setting the trend parameter to exclude trend behavior will set all trend-related parameters to their default value; these then do not occur in the model anymore. (They are, for example, not counted by NumberOfParameters.)
 • For both GetParameter and SetParameter, if the global variable with the same name as the parameter is assigned a value, it may be necessary to protect it from evaluation using uneval quotes, as in $'\mathrm{\alpha }'$.
 • The help page for exponential smoothing models has an explanation of the legal values for its parameters.

Examples

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

Consider an exponential smoothing model. Initially all parameters are unset, except for the errors, trend, and seasonal parameters that determine what the model can be specialized to, and the constraints parameter that determines whether traditional and/or admissibility constraints are enforced.

 > $\mathrm{model}≔\mathrm{ExponentialSmoothingModel}\left(\right)$
 ${\mathrm{model}}{≔}{\mathrm{< an ETS\left(*,*,*\right) model >}}$ (1)
 > $\mathrm{GetParameters}\left(\mathrm{model}\right)$
 $\left[{\mathrm{errors}}{=}\left\{{"A"}{,}{"M"}\right\}{,}{\mathrm{trend}}{=}\left\{{"A"}{,}{"Ad"}{,}{"M"}{,}{"Md"}{,}{"N"}\right\}{,}{\mathrm{seasonal}}{=}\left\{{"A"}{,}{"M"}{,}{"N"}\right\}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\phi }}{,}{\mathrm{period}}{,}{\mathrm{l0}}{,}{\mathrm{b0}}{,}{s}{,}{\mathrm{\sigma }}{,}{\mathrm{constraints}}{=}{"both"}\right]$ (2)

If we set the trend parameter to {"A", "M"} (signifying that the trend is additive or multiplicative, but not damped), we will get a warning that the current value is being overwritten. Also, the parameter phi (which determines damping) is set to its default value, $1.0$.

 > $\mathrm{SetParameter}\left(\mathrm{model},'\mathrm{trend}'=\left\{"A","M"\right\}\right)$
 Warning, changing parameter trend from value {"A", "Ad", "M", "Md", "N"} to value {"A", "M"}
 > $\mathrm{GetParameters}\left(\mathrm{model},'\mathrm{output}=\mathrm{assigned}'\right)$
 $\left[{\mathrm{errors}}{=}\left\{{"A"}{,}{"M"}\right\}{,}{\mathrm{trend}}{=}\left\{{"A"}{,}{"M"}\right\}{,}{\mathrm{seasonal}}{=}\left\{{"A"}{,}{"M"}{,}{"N"}\right\}{,}{\mathrm{\phi }}{=}{1.}{,}{\mathrm{constraints}}{=}{"both"}\right]$ (3)

Consider an exponential smoothing model with parameters $\left(M,N,A\right)$ where we fix $\mathrm{\alpha }$ to be $\frac{2}{3}$.

 > $\mathrm{model2}≔\mathrm{ExponentialSmoothingModel}\left(M,N,A,\mathrm{α}=\frac{2}{3}\right)$
 ${\mathrm{model2}}{≔}{\mathrm{< an ETS\left(M,N,A\right) model >}}$ (4)

Let us verify the values of $\mathrm{\alpha }$ and of the parameters errors, trend, and seasonal.

 > $\mathrm{GetParameter}\left(\mathrm{model2},\mathrm{α}\right)$
 $\frac{{2}}{{3}}$ (5)
 > $\mathrm{GetParameter}\left(\mathrm{model2},\left['\mathrm{errors}','\mathrm{trend}','\mathrm{seasonal}'\right]\right)$
 $\left[\left\{{"M"}\right\}{,}\left\{{"N"}\right\}{,}\left\{{"A"}\right\}\right]$ (6)

These are the unassigned parameters:

 > $\mathrm{GetParameters}\left(\mathrm{model2},'\mathrm{output}=\mathrm{unassigned}'\right)$
 $\left[{\mathrm{\gamma }}{,}{\mathrm{period}}{,}{\mathrm{l0}}{,}{s}{,}{\mathrm{\sigma }}\right]$ (7)

Compatibility

 • The TimeSeriesAnalysis[GetParameter], TimeSeriesAnalysis[GetParameters] and TimeSeriesAnalysis[SetParameter] commands were introduced in Maple 18.