Rev 6562 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File nlme/man/ACF.gls.Rd% Part of the nlme package for R% Distributed under GPL 2 or later: see nlme/LICENCE.note\name{ACF.gls}\title{Autocorrelation Function for gls Residuals}\usage{\method{ACF}{gls}(object, maxLag, resType, form, na.action, \dots)}\alias{ACF.gls}\arguments{\item{object}{an object inheriting from class \code{"\link{gls}"}, representinga generalized least squares fitted model.}\item{maxLag}{an optional integer giving the maximum lag for which theautocorrelation should be calculated. Defaults to maximum lag in theresiduals.}\item{resType}{an optional character string specifying the type ofresiduals to be used. If \code{"response"}, the "raw" residuals(observed - fitted) are used; else, if \code{"pearson"}, thestandardized residuals (raw residuals divided by the correspondingstandard errors) are used; else, if \code{"normalized"}, thenormalized residuals (standardized residuals pre-multiplied by theinverse square-root factor of the estimated error correlationmatrix) are used. Partial matching of arguments is used, so only thefirst character needs to be provided. Defaults to \code{"pearson"}.}\item{form}{an optional one sided formula of the form \code{~ t}, or\code{~ t | g}, specifying a time covariate \code{t} and, optionally, agrouping factor \code{g}. The time covariate must be integervalued. When a grouping factor is present in\code{form}, the autocorrelations are calculated using residual pairswithin the same group. Defaults to \code{~ 1}, which corresponds tousing the order of the observations in the data as a covariate, andno groups.}\item{na.action}{a function that indicates what should happen when thedata contain \code{NA}s. The default action (\code{na.fail}) causes\code{ACF.gls} to print an error message and terminate if there are anyincomplete observations.}\item{\dots}{some methods for this generic require additionalarguments.}}\description{This method function calculates the empirical autocorrelation functionfor the residuals from a \code{gls} fit. If a grouping variable isspecified in \code{form}, the autocorrelation valuesare calculated using pairs of residuals within the same group;otherwise all possible residual pairs are used. The autocorrelationfunction is useful for investigating serial correlation models forequally spaced data.}\value{a data frame with columns \code{lag} and \code{ACF} representing,respectively, the lag between residuals within a pair and the correspondingempirical autocorrelation. The returned value inherits from class\code{ACF}.}\references{Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time SeriesAnalysis: Forecasting and Control", 3rd Edition, Holden-Day.Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Modelsin S and S-PLUS", Springer.}\author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}}\seealso{\code{\link{ACF.lme}}, \code{\link{plot.ACF}}}\examples{fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary)ACF(fm1, form = ~ 1 | Mare)# Pinheiro and Bates, p. 255-257fm1Dial.gls <- gls(rate ~(pressure+I(pressure^2)+I(pressure^3)+I(pressure^4))*QB,Dialyzer)fm2Dial.gls <- update(fm1Dial.gls,weights = varPower(form = ~ pressure))ACF(fm2Dial.gls, form = ~ 1 | Subject)}\keyword{models}