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

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

TimeSeriesAnalysis[Decomposition] - decompose a time series into level, residuals, and potentially trend and seasonal components

 Calling Sequence Decomposition(model, ts, extraparameters)

Parameters

 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

 > $\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)

Fit an exponential smoothing model to it.

 > $\mathrm{esm}:=\mathrm{ExponentialSmoothingModel}\left(\mathrm{ts}\right)$
 ${\mathrm{esm}}{:=}{\mathrm{< an ETS\left(M,A,M\right) model >}}$ (2)

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

 > $\mathrm{dc}:=\mathrm{Decomposition}\left(\mathrm{esm},\mathrm{ts}\right)$
 ${\mathrm{dc}}{:=}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{Visitor nights \left(residuals\right), ..., Visitor nights \left(seasonal\right)}}\\ {\mathrm{24 rows of data:}}\\ {\mathrm{2005-Jan-01 - 2010-Oct-01}}\end{array}\right]$ (3)

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

 > $\mathrm{TimeSeriesPlot}\left(\mathrm{dc},'\mathrm{split}'=\left[\left[\mathrm{dc},1,4\right],\left[\mathrm{dc},2\right],\left[\mathrm{dc},3\right]\right],'\mathrm{color}=\mathrm{red}..\mathrm{blue}'\right)$

 >