BoxCoxTransform - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

TimeSeriesAnalysis

  

BoxCoxTransform

  

Box-Cox transformation

  

LogTransform

  

Log transformation

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Apply(BoxCoxTransform, timeseries)

Apply(BoxCoxTransform(lambda = lm, base = b, geometricmean = g, shift = s), timeseries)

Apply(LogTransform, timeseries)

Apply(LogTransform(base = b, geometricmean = g, shift = s), timeseries)

Unapply(BoxCoxTransform, forecast)

Unapply(BoxCoxTransform(lambda = lm, base = b, geometricmean = g, shift = s), forecast)

Unapply(LogTransform, forecast)

Unapply(LogTransform(base = b, geometricmean = g, shift = s), forecast)

Parameters

timeseries

-

TimeSeries data set

forecast

-

TimeSeries data set, typically obtained from a forecasting method

lm

-

(optional) parameter of the Box-Cox transform, typically between  and

b

-

(optional) if lm is , the base of the logarithm

g

-

(optional) true or false, indicating whether or not to correct the scale of the results using the geometric mean

s

-

(optional) constant shift applied before the Box-Cox transform is applied

Description

• 

The Box-Cox transformation takes a time series and replaces each value  with the value . If the parameter  is set to , the resulting value is .

• 

Apply this transformation to a time series using the Apply command. Translate transformed information, such as a forecast from transformed data, back to the original domain by using the Unapply command.

• 

By default, the  parameter has value , and the transformation is the log transformation (the natural logarithm, with base ). By supplying the  option, you can set this parameter to a different value. The command LogTransform is the same as BoxCoxTransform, except you cannot supply the lambda parameter: it is fixed to always be .

• 

If , then you can choose to use a different base for the logarithm by supplying the  option. For example, to obtain the common logarithm, supply the option . It is an error to supply the  option if  is set to a value different from . The default base is .

• 

Negative data points result in undefined values. To prevent this from happening, you can supply the  option. The value  is added to each data point before the transformation is applied. By default,  is .

• 

Applying a Box-Cox transformation may have the transformed time series being of a different order of magnitude than the original time series, and Box-Cox transformations with different values for the parameter  may also have different orders of magnitude. If this is undesirable, for example when comparing an absolute measure of error involving the results of different Box-Cox transformations, you can supply the geometricmean = true option. This computes the geometric mean of each data set after the shift is applied but before the transformation is applied; then after applying the transformation, each data value is multiplied by this geometric mean, raised to the power . This can be viewed as preserving the units of measurement that the time series data is expressed in.

Examples

(1)

(2)

Here are the log-transformed data.

(3)

(4)

Reconstructing the original data:

(5)

(6)

Apply the logarithm with base 10 instead.

(7)

(8)

(9)

(10)

We now apply the Box-Cox transformation with parameter  to the sales data. We also apply the geometric mean correction.

(11)

(12)

(13)

(14)

Temperature data in Celsius is sometimes negative. These were the daily minimum and maximum temperatures in Waterloo, Ontario, Canada, averaged over a month.

(15)

(16)

In order to apply the Box-Cox transform, we need to shift the data by a number greater than minus the minimum value, .

(17)

(18)

(19)

(20)

(21)

Compatibility

• 

The TimeSeriesAnalysis[BoxCoxTransform] and TimeSeriesAnalysis[LogTransform] commands were introduced in Maple 18.

• 

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

See Also

TimeSeriesAnalysis

TimeSeriesAnalysis[Difference]

 


Download Help Document