TimeSeriesAnalysis
Apply
apply a transformation
Unapply
unapply a transformation
Calling Sequence
Parameters
Description
Examples
Compatibility
Apply(trafo, timeseries)
Unapply(trafo, forecast)
trafo
-
TimeSeries transformation object, such as BoxCoxTransform or Difference
timeseries
TimeSeries data set
forecast
TimeSeries data set, typically obtained from a forecasting method
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.
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
GetData⁡sales..4
150.147.114.113.
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
GetData⁡log_sales..4
5.010635294096264.990432586778744.736198448394504.72738781871234
Reconstructing the original data:
original≔Unapply⁡LogTransform,log_sales
original≔Time seriesWeekly Sales10 rows of data:2010-01-01 - 2010-03-05
GetData⁡original..4
150.000000000000147.000000000000114.000000000000113.000000000000
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
GetData⁡differenced..4
−3.−33.−1.−22.
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
147.114.113.91.
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
Download Help Document