BoxCox: Box Cox Transformation

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

BoxCox() returns a transformation of the input variable using a Box-Cox transformation. InvBoxCox() reverses the transformation.

Usage

1
2
BoxCox(x, lambda)
InvBoxCox(x, lambda, biasadj=FALSE, fvar=NULL)

Arguments

x

a numeric vector or time series

lambda

transformation parameter

biasadj

Use adjusted back-transformed mean for Box-Cox transformations. If TRUE, point forecasts and fitted values are mean forecast. Otherwise, these points can be considered the median of the forecast densities.

fvar

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.

Details

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)

.

Value

a numeric vector of the same length as x.

Author(s)

Rob J Hyndman & Mitchell O'Hara-Wild

References

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

See Also

BoxCox.lambda

Examples

1
2
3
lambda <- BoxCox.lambda(lynx)
lynx.fit <- ar(BoxCox(lynx,lambda))
plot(forecast(lynx.fit,h=20,lambda=lambda))

pli2016/forecast documentation built on May 25, 2019, 8:22 a.m.