bxcx: Box-Cox Transformation and its Inverse

Description Usage Arguments Value Author(s) References Examples

Description

Box-Cox or power transformation or its inverse. For lambda!=0, the Box-Cox transformation of x is (x^lambda-1)/lambda, whereas the regular power transformation is simply x^lambda. When lambda=0, it is log in both cases. The inverse of the Box-Cox and the power transform can also be obtained.

Usage

1
bxcx(x, lambda, InverseQ = FALSE, type = "BoxCox")

Arguments

x

a vector or time series

lambda

power transformation parameter

InverseQ

if TRUE, the inverse transformation is done

type

either "BoxCox" or "power"

Value

A vector or time series of the transformed data

Author(s)

A.I. McLeod. R package FitAR

References

- Box, G.E.P. and Cox, D.R. (1964). An analysis of transformations. Journal of Royal Statistical Society Series B 26, 211-246.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#lambda=0.5
z<-AirPassengers; lambda<-0.5
y<-bxcx(z, lambda)
z2<-bxcx(y, lambda, InverseQ=TRUE)
sum(abs(z2-z))
#
z<-AirPassengers; lambda<-0.0
y<-bxcx(z, lambda)
z2<-bxcx(y, lambda, InverseQ=TRUE)
sum(abs(z2-z))

sae documentation built on March 26, 2020, 7:52 p.m.