BoxCox.Rd
BoxCox()
returns a transformation of the input variable using a Box-Cox transformation.BoxCoxInv()
reverses the transformation.
BoxCox(x, lambda)
BoxCoxInv(x, lambda)
The Box-Cox transformation is given by
fλ(x)={xλ−1λ\textupforλ≠0log(x)\textupforλ=0
a numeric vector of the same length as x.
Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations. JRSS B 26 211–246.
Use BoxCoxLambda
or boxcox
in library(MASS)
to find optimal lambda values.
These two functions are borrowed from library(forecast)
.