acf(x, lag.max=NULL, type="correlation", plot=T ...)
x
is a matrix, rows are treated as timepoints and columns as
univariate series.
"covariance"
to estimate the autocovariance function,
"correlation"
for the autocorrelation function,
or
"partial"
, if the partial autocorrelation function is desired.
The start of one of the strings will suffice.
TRUE
, the autocovariance or autocorrelation function between pairs
of univariate series will be plotted in an array of at most 5 by 5 plots per page.
If
type
is
"correlation"
or
"partial"
approximate 95% confidence limits
are drawn on the plots.
plot=TRUE
, these arguments are passed to the
acf.plot
function.
acf[i,j,k]
is the covariance (or correlation) between the
j
-th series at time
t
and the
k
-th series at time
t+1-i
.
acf
containing
the lags (as fractions of the sampling period) at which
acf
is calculated.
If j > k and i > 1, then
lag[i,j,k]
is negative.
"covariance"
,
"correlation"
or
"partial"
.
x
, including transformations.
if
plot
is
TRUE
, a high density plot (
type="h"
) of the resulting function
will be produced including the 95% confidence limits about zero.
The autocovariance function is estimated by summing the lagged products and
dividing by the length of the series.
For the autocorrelation function, all covariances are further divided
by the geometric mean of the corresponding variances.
For the partial autocorrelation function, the Levinson-Durbin recursion is used
to fit AR(p) models to
x
successively for p = 1, ...,
lag.max
, and from the
AR-coefficients the partial autocorrelation function values are derived.
Both the autocorrelation function (acf) and partial autocorrelation function (pacf) are useful tools in ARIMA model identification. The autocovariance function describes the serial dependence structure of a time series. The time series is generally assumed to be stationary before these tools are used for Box and Jenkins modeling purposes.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
acf.lynx <- acf(lynx, 36, "correlation") corn.rts <- rts(cbind(corn.rain, corn.yield), start=1890, units="years", names=c("rain", "yield") ) pacf.corn <- acf(corn.rts, 6, "partial")