BoxCox {forecast} | R Documentation |
BoxCox() returns a transformation of the input variable using a Box-Cox transformation. InvBoxCox() reverses the transformation.
BoxCox(x,lambda) InvBoxCox(x,lambda)
x |
a numeric vector or time series |
lambda |
transformation parameter |
The Box-Cox transformation is given by
f(x;lambda) = (x^lambda - 1)/lambda
if lambda is not equal to 0. For lambda=0,
f(x;0) = log(x)
.
a numeric vector of the same length as x.
Rob J Hyndman
Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations. JRSS B 26 211–246.
lynx.sqrt <- BoxCox(lynx,0.5) lynx.fit <- ar(lynx.sqrt) plot(forecast(lynx.fit,h=20),lambda=0.5)