TimeSeriesAnalysis - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

TimeSeriesAnalysis

  

Decomposition

  

decompose a time series into level, residuals, and potentially trend and seasonal components

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

Decomposition(model, ts, extraparameters)

Parameters

model

-

Exponential smoothing model

ts

-

Time series consisting of a single data set

extraparameters

-

(optional) table of parameter values

Description

• 

The Decomposition command takes a time series and decomposes it according to an exponential smoothing model.

• 

It returns a time series with two, three, or four data sets in it: one for the level, one for the residuals, if the model has a trend component then one data set for the trends, and if the model has a seasonal component then a data set for the seasonal component.

Examples

with(TimeSeriesAnalysis):

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

ts := TimeSeries(<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>, startdate="2005", frequency=quarterly, header="Visitor nights");

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

(1)

Fit an exponential smoothing model to it.

esm := ExponentialSmoothingModel(ts);

TimeSeriesAnalysis:-ExponentialSmoothingModelerrors&equals;M&comma;trend&equals;A&comma;seasonal&equals;M&comma;&alpha;&equals;0.4836790988889591&comma;&beta;&equals;0.0003088251694408857&comma;&gamma;&equals;0.00023143579040411943&comma;&phi;&equals;1.&comma;period&equals;4&comma;l0&equals;31.691916154639692&comma;b0&equals;0.6527296503176275&comma;s&equals;1.26414378538616550.76021134929557480.9460579159850541.0295918919494698&comma;&sigma;&equals;0.03343189749472918&comma;constraints&equals;both

(2)

Create the decomposition. Since this is a model with both trend and seasonal components, you get four data sets.

dc := Decomposition(esm, ts);

dcTime seriesVisitor nights (residuals), ..., Visitor nights (seasonal)24 rows of data:2005-Jan-01 - 2010-Oct-01

(3)

Since the error and seasonal components are multiplicative, it makes sense to display them together. The trend and level components are displayed separately.

TimeSeriesPlot(dc, 'split' = [[dc, 1, 4], [dc, 2], [dc, 3]], 'color = red .. blue');

 

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

• 

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

See Also

TimeSeriesAnalysis