Apply - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


TimeSeriesAnalysis

  

Apply

  

apply a transformation

  

Unapply

  

unapply a transformation

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Apply(trafo, timeseries)

Unapply(trafo, forecast)

Parameters

trafo

-

TimeSeries transformation object, such as BoxCoxTransform or Difference

timeseries

-

TimeSeries data set

forecast

-

TimeSeries data set, typically obtained from a forecasting method

Description

• 

The Apply and Unapply commands are used with transformation objects, and are explained on the help pages of these transformation objects.

• 

Transformation objects are created by the Difference and BoxCoxTransform commands. The LogTransform command is a special case of the BoxCoxTransform command.

Examples

> 

with⁡TimeSeriesAnalysis:

> 

sales≔TimeSeries⁡150,147,114,113,91,164,56,39,32,86,startdate=2010-01-01,frequency=weekly,header=Weekly Sales

sales≔Time seriesWeekly Sales10 rows of data:2010-01-01 - 2010-03-05

(1)
> 

GetData⁡sales..4

150.147.114.113.

(2)

Here are the log-transformed data.

> 

log_sales≔Apply⁡LogTransform,sales

log_sales≔Time seriesLogarithm of Weekly Sales10 rows of data:2010-01-01 - 2010-03-05

(3)
> 

GetData⁡log_sales..4

5.010635294096264.990432586778744.736198448394504.72738781871234

(4)

Reconstructing the original data:

> 

original≔Unapply⁡LogTransform,log_sales

original≔Time seriesWeekly Sales10 rows of data:2010-01-01 - 2010-03-05

(5)
> 

GetData⁡original..4

150.000000000000147.000000000000114.000000000000113.000000000000

(6)

Here are the differences in sales from week to week.

> 

differenced≔Apply⁡Difference,sales

differenced≔Time seriesWeekly Sales (differenced)9 rows of data:2010-01-08 - 2010-03-05

(7)
> 

GetData⁡differenced..4

−3.−33.−1.−22.

(8)

Reconstructing the original data (except for the first row):

> 

original≔Unapply⁡Difference,differenced

original≔Time seriesWeekly Sales9 rows of data:2010-01-08 - 2010-03-05

(9)
> 

GetData⁡original..4

147.114.113.91.

(10)

Compatibility

• 

The TimeSeriesAnalysis[Apply] and TimeSeriesAnalysis[Unapply] commands were introduced in Maple 18.

• 

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

See Also

BoxCoxTransform

Difference

LogTransform

TimeSeriesAnalysis