BoxCox() returns a transformation of the input variable using a Box-Cox transformation. InvBoxCox() reverses the transformation.
BoxCox(x, lambda)InvBoxCox(x, lambda, biasadj = FALSE, fvar = NULL)
a numeric vector or time series of class ts
.
transformation parameter. If lambda = "auto"
, then
the transformation parameter lambda is chosen using BoxCox.lambda.
Use adjusted back-transformed mean for Box-Cox transformations. If transformed data is used to produce forecasts and fitted values, a regular back transformation will result in median forecasts. If biasadj is TRUE, an adjustment will be made to produce mean forecasts and fitted values.
Optional parameter required if biasadj=TRUE. Can either be the
forecast variance, or a list containing the interval level
, and the
corresponding upper
and lower
intervals.
a numeric vector of the same length as x.
The Box-Cox transformation is given by
Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations. JRSS B 26 211--246.
# NOT RUN {
lambda <- BoxCox.lambda(lynx)
lynx.fit <- ar(BoxCox(lynx,lambda))
plot(forecast(lynx.fit,h=20,lambda=lambda))
# }
Run the code above in your browser using DataLab