boxcox: Box-Cox Transformation

View source: R/boxcox.R

boxcoxR Documentation

Box-Cox Transformation

Description

Compute Box-Cox transformation and find an optimal lambda with minimum AIC.

Usage

boxcox(y, plot = TRUE, ...)

Arguments

y

a univariate time series.

plot

logical. If TRUE (default), original data and transformed data with minimum AIC are plotted.

...

graphical arguments passed to plot.boxcox.

Value

An object of class "boxcox", which is a list with the following components:

mean

mean of original data.

var

variance of original data.

aic

AIC of the model with respect to the original data.

llkhood

log-likelihood of the model with respect to the original data.

z

transformed data with the AIC best lambda.

aic.z

AIC of the model with respect to the transformed data.

llkhood.z

log-likelihood of the model with respect to the transformed data.

References

Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.

Examples

# Sunspot number data
data(Sunspot)
boxcox(Sunspot)

# Wholesale hardware data
data(WHARD)
boxcox(WHARD)

TSSS documentation built on Sept. 29, 2023, 9:07 a.m.