BoxCox.numeric: Box-Cox Analysis for a Time Series

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

Description

An AR(p) model is selected using AIC and then the best Box-Cox transformation is determined. Requires package FitAR.

Usage

1
2
## S3 method for class 'numeric'
BoxCox(object, interval = c(-1, 1), IIDQ = FALSE, ...)

Arguments

object

a vector of time series values

interval

interval to be searched

IIDQ

If true, IID is assumed, ie. p=0. If FALSE, AR(p) is fit with p determined using AIC.

...

optional arguments

Details

For lambda!=0, the Box-Cox transformation is of x is (x^lambda-1)/lambda.

If the minimum data value is <= 0, a small positive constant, equal to the negative of the minimum plus 0.25, is added to all the data values. If length(object) < 20, no AR model is used, that is, p=0.

Value

No value returned. Graphical output produced as side-effect. The plot shows relative likelihood funciton as well as the MLE and a confidence interval.

Note

The MASS package has a similar function boxcox but this is implemented only for regression and analysis of variance.

Author(s)

A.I. McLeod and Y. Zhang

References

Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations. Journal of Royal Statistical Society, Series B, vol. 26, pp. 211-246.

See Also

BoxCox.FitAR, BoxCox.Arima, BoxCox.ts

Examples

1
2
3
4
5
6
7
8
## Not run: #takes a few seconds
#annual sunspot series
BoxCox(sunspot.year, IIDQ=FALSE)
#
#non-time series example, lengths of rivers
BoxCox(rivers)

## End(Not run)

Example output

Loading required package: lattice
Loading required package: leaps
Loading required package: ltsa
Loading required package: bestglm
 minimum data value <= 0 so -min+0.25 added to all values

FitAR documentation built on May 2, 2019, 3:22 a.m.