BCT function

Box Cox Transformation

Box Cox Transformation

The BCT() function returns a transformation of the provided time series using a Box-Cox transformation. BCT.rev() reverses the transformation. Wrapper functions for BoxCox and InvBoxCox of the forecast package, respectively.

BCT(x, lambda = NULL, ...) BCT.rev(x, lambda, ...)

Arguments

  • x: A numeric vector or univariate time series of class ts.
  • lambda: Box-Cox transformation parameter. If NULL, lambda is selected using BoxCox.lambda of the forecast package.
  • ...: Additional arguments passed to the BoxCox.lambda function for BCT(), and to the InvBoxCox function for BCT.rev().

Returns

A vector of the same length as x containing the transformed values.

Details

If lambda is not 0, the Box-Cox transformation is given by

fλ(x)=xλ1λ f_\lambda(x) =\frac{x^\lambda - 1}{\lambda}

If λ=0\lambda=0, the Box-Cox transformation is given by

f0(x)=log(x) f_0(x)=\log(x)

.

Examples

data(CATS) BCT(CATS[,1])

References

Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations. JRSS B 26 211--246.

See Also

DIF,detrend, MAS, LT, PCT

Author(s)

Rebecca Pontes Salles

  • Maintainer: Rebecca Pontes Salles
  • License: GPL (>= 2)
  • Last published: 2021-01-21