Box-Cox Analysis for "FitAR" Objects
This is a methods function to do a Box-Cox analysis for models fit using FitAR.
## S3 method for class 'FitAR' BoxCox(object, interval = c(-1, 1), type = "BoxCox", InitLambda = "none", ...)
object |
output from FitAR |
interval |
interval to be searched for the optimal transformation |
type |
Ignored unless, InitLambda!="none". Type of transformation, default is "BoxCox". Otherwise a simple power transformation. |
InitLambda |
default "none". Otherwise a numerical value giving the transformation parameter. |
... |
optional arguments passed to optimize |
If no transformation is used on the data, then the original data is used. But if a transformation has already been used, we need to inverse transform the data to recover the untransformed data.
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.
No value returned. Graphical output produced as side-effect. The plot shows relative likelihood function as well as the MLE and a confidence interval.
The MASS package has a similar function boxcox
but this is implemented
only for regression and analysis of variance.
A.I. McLeod
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.
McLeod, A.I. and Zhang, Y. (2006a). Partial autocorrelation parameterization for subset autoregression. Journal of Time Series Analysis, 27, 599-612.
McLeod, A.I. and Zhang, Y. (2006b, under review). Subset Autoregression Modelling. Journal of Statistical Sofware.
## Not run: #takes a few seconds #lynx time series. ARp subset model. out<-FitAR(lynx, c(1,2,4,10,11), ARModel="ARp") BoxCox(out) # #lynx time series. ARz subset model. p<-SelectModel(lynx, ARModel="ARz", lag.max=25, Best=1) out<-FitAR(lynx, p) BoxCox(out) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.