BoxCoxLambda: Automatic Selection of Box Cox Transformation Parameter

View source: R/DescTools.r

BoxCoxLambdaR Documentation

Automatic Selection of Box Cox Transformation Parameter

Description

An automatic selection of the Box Cox transformation parameter is estimated with two methods.
Guerrero's (1993) method yields a lambda which minimizes the coefficient of variation for subseries of x. For method "loglik", the value of lambda is chosen to maximize the profile log likelihood of a linear model fitted to x. For non-seasonal data, a linear time trend is fitted while for seasonal data, a linear time trend with seasonal dummy variables is used.

Usage

BoxCoxLambda(x, method = c("guerrero", "loglik"), lower = -1, upper = 2)

Arguments

x

a numeric vector or time series

method

method to be used in calculating lambda. Can be either "guerrero" (default) or "loglik".

lower

lower limit for possible lambda values, default is -1.

upper

upper limit for possible lambda values, default is 2.

Value

a number indicating the Box-Cox transformation parameter.

Note

This function was previously published as BoxCox.lambda() in the forecast package and has been integrated here without logical changes.

Author(s)

Leanne Chhay and Rob J Hyndman

References

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

Guerrero, V.M. (1993) Time-series analysis supported by power transformations. Journal of Forecasting, 12, 37–48.

See Also

BoxCox

Examples


lambda <- BoxCoxLambda(AirPassengers, lower=0)


AndriSignorell/DescTools documentation built on Dec. 1, 2024, 5:13 a.m.