\name{mean.acf}
\alias{mean.acf}
\title{
  Mean of ACFs
}
\description{
  Mean of objects of class 'acf'
}
\usage{
\method{mean}{acf}(x, ...)
}
\arguments{
  \item{x}{
    an object of class 'acf'
  }
  \item{\dots}{
    other objects of class 'acf'.
  }
}
\details{
  1.  dots <- list(...)

  2.  nd <- length(dots);  if length(nd)<1)return(x) with warning

  3.  Check:  All arguments of class 'acf' and univariate?  If no,
  error.

  4.  x. <- x

  5.  Lags <- min(length(x$acf), sapply(dots, function(x)length(x$acf)))

  6.  x.$acf <- mean of (x, dots)$acf[1:Lags]

  7.  x.$n.used <- (sum of (x, dots)$n.used) - nd

  8.  x.$lag <- array(seq(0, Lag-1), dim=c(Lag, 1, 1))

  9.  x.$series <- list(x$series, dots$series)
}
\value{
  an object of class 'acf';  see details above.
}
\author{
  Spencer Graves, Structure Inspection and Monitoring, Inc.
}
\seealso{
  \code{\link{acf}}
  \code{\link{mean}}
}
%\references{}
\examples{
acf1 <- acf(1:5, plot=FALSE)
acf2 <- acf((-1)^(1:7), plot=FALSE)
acf3 <- acf((1:8)^2, plot=FALSE)

acf123 <- mean(acf1, acf2, acf3)

# check
acf. <- acf1
Lag <- min(length(acf1$acf), length(acf2$acf),
           length(acf3$acf))
acf.$acf <- (acf1$acf[1:Lag] + acf2$acf[1:Lag] +
             acf3$acf[1:Lag])/3
acf.$n.used <- (acf1$n.used + acf2$n.used +
                acf3$n.used - 2)
acf.$lag <- array(seq(0, Lag-1), dim=c(Lag, 1, 1))
acf.$series <- list(acf1$series, acf2$series,
                    acf3$series)

\dontshow{stopifnot(}
all.equal(acf123, acf.)
\dontshow{)}
}
\keyword{arith}
