ACF.lme | R Documentation |
This method function calculates the empirical autocorrelation function
for the within-group residuals from an lme
fit. The
autocorrelation values are calculated using pairs of residuals within
the innermost group level. The autocorrelation function is useful for
investigating serial correlation models for equally spaced data.
## S3 method for class 'lme'
ACF(object, maxLag, resType, ...)
object |
an object inheriting from class |
maxLag |
an optional integer giving the maximum lag for which the autocorrelation should be calculated. Defaults to maximum lag in the within-group residuals. |
resType |
an optional character string specifying the type of
residuals to be used. If |
... |
some methods for this generic require additional arguments – not used. |
a data frame with columns lag
and ACF
representing,
respectively, the lag between residuals within a pair and the corresponding
empirical autocorrelation. The returned value inherits from class
ACF
.
José Pinheiro and Douglas Bates bates@stat.wisc.edu
Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day.
Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer.
ACF.gls
, plot.ACF
fm1 <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time),
Ovary, random = ~ sin(2*pi*Time) | Mare)
ACF(fm1, maxLag = 11)
# Pinheiro and Bates, p240-241
fm1Over.lme <- lme(follicles ~ sin(2*pi*Time) +
cos(2*pi*Time), data=Ovary,
random=pdDiag(~sin(2*pi*Time)) )
(ACF.fm1Over <- ACF(fm1Over.lme, maxLag=10))
plot(ACF.fm1Over, alpha=0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.