TimeSeriesAnalysis - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

TimeSeriesAnalysis

  

Optimize

  

fit parameters of an exponential smoothing model to a time series

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

Optimize(model, ts, init)

Parameters

model

-

Exponential smoothing model

ts

-

Time series consisting of a single data set

init

-

(optional) table of initial parameter values

Description

• 

The Optimize command will fit unassigned parameter values of model to maximize the likelihood of obtaining the time series ts.

• 

If a parameter was fixed when creating model, its value will not be subject to optimization. For example, if the calling sequence of ExponentialSmoothingModel includes the option alpha = 0.3, then calling Optimize on the resulting model keeps alpha fixed. (This is also true if Optimize is called automatically when ExponentialSmoothingModel gets a Time series as its first argument.)

• 

Optimize is only guaranteed to find a local optimum; it calls Optimization[NLPSolve]. It uses the nonlinear simplex method (also known as Nelder-Mead).

• 

The optimization process needs to be started with an initial point; this point is given by init. It uses the format returned by Initialize: it is a table with parameter names as indices and parameter values as values. If init is not given, Optimize calls Initialize and uses its output by default.

Examples

withTimeSeriesAnalysis:

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

tsTimeSeries41.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,startdate=2005,frequency=quarterly,header=Visitor nights

tsTime seriesVisitor nights24 rows of data:2005-Jan-01 - 2010-Oct-01

(1)

esmExponentialSmoothingModelseasonal=A,M,constraints=admissible

esm< an ETS(*,*,*) model >

(2)

Transform to a collection of specialized models.

modelsSpecializeesm&comma;ts

models< an ETS(A,A,A) model >&comma;< an ETS(A,Ad,A) model >&comma;< an ETS(A,N,A) model >&comma;< an ETS(M,A,A) model >&comma;< an ETS(M,A,M) model >&comma;< an ETS(M,Ad,A) model >&comma;< an ETS(M,Ad,M) model >&comma;< an ETS(M,M,M) model >&comma;< an ETS(M,Md,M) model >&comma;< an ETS(M,N,A) model >&comma;< an ETS(M,N,M) model >

(3)

Find initial points for optimization for all of these.

initsmapInitialize&comma;models&comma;ts&colon;

Optimize all of them.

foritonumelemsmodelsdoOptimizemodelsi&comma;ts&comma;initsiend do&colon;

Alternatively, we can let Optimize call Initialize for us.

models2Specializeesm&comma;ts

models2< an ETS(A,A,A) model >&comma;< an ETS(A,Ad,A) model >&comma;< an ETS(A,N,A) model >&comma;< an ETS(M,A,A) model >&comma;< an ETS(M,A,M) model >&comma;< an ETS(M,Ad,A) model >&comma;< an ETS(M,Ad,M) model >&comma;< an ETS(M,M,M) model >&comma;< an ETS(M,Md,M) model >&comma;< an ETS(M,N,A) model >&comma;< an ETS(M,N,M) model >

(4)

mapOptimize&comma;models2&comma;ts

43.87641045&comma;43.30741702&comma;47.25550594&comma;43.49539348&comma;42.02319299&comma;42.42526190&comma;40.68983138&comma;42.92489529&comma;40.42353080&comma;46.41831579&comma;46.75393519

(5)

Evaluate the Bayesian information criterion for each model.

mapmodel&rarr;printmodel&comma;BICmodel&comma;ts&comma;models&colon;

< an ETS(A,A,A) model >&comma;126.7819508

< an ETS(A,Ad,A) model >&comma;126.9258852

< an ETS(A,N,A) model >&comma;129.9242821

< an ETS(M,A,A) model >&comma;141.6667862

< an ETS(M,A,M) model >&comma;109.4702551

< an ETS(M,Ad,A) model >&comma;135.7502647

< an ETS(M,Ad,M) model >&comma;109.9821406

< an ETS(M,M,M) model >&comma;111.2692148

< an ETS(M,Md,M) model >&comma;109.4060877

< an ETS(M,N,A) model >&comma;140.6230023

< an ETS(M,N,M) model >&comma;112.5756460

(6)

Compare all models' fits.

colorsColorTools:-GradientNiagara Navy..Niagara Purple&comma;number&equals;numelemsmodels

colorsRGB : 0 0.0549 0.471&comma;RGB : 0.0392 0.0503 0.469&comma;RGB : 0.0784 0.0458 0.467&comma;RGB : 0.118 0.0412 0.465&comma;RGB : 0.157 0.0366 0.463&comma;RGB : 0.196 0.032 0.461&comma;RGB : 0.235 0.0275 0.459&comma;RGB : 0.275 0.0229 0.457&comma;RGB : 0.314 0.0183 0.455&comma;RGB : 0.353 0.0137 0.453&comma;RGB : 0.392 0.00915 0.451&comma;RGB : 0.431 0.00458 0.449&comma;RGB : 0.471 0 0.447

(7)

TimeSeriesPlotseqOneStepForecastsmodelsi&comma;ts&comma;color&equals;ToPlotColorcolorsi&comma;legend&equals;modelsi&comma;i&equals;1..numelemsmodels&comma;ts&comma;color&equals;Niagara Green&comma;thickness&equals;3

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[Optimize] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

Exponential smoothing model

Initialize

LogLikelihood

Specialize

TimeSeriesAnalysis

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam