a regular or calendar time series,
or a vector or matrix. Time series may be univariate or multivariate.
Missing values are allowed only at the beginning or end of series.
Factor data are not allowed. If
x is a matrix, rows are treated as timepoints and columns as
univariate series.
OPTIONAL ARGUMENTS:
lag.max:
the maximum number of lags at which to estimate the autocovariance.
If this is not supplied, it is a number proportional to the logarithm of the
length of the series.
type:
a character string:
"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.
plot:
If 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.
VALUE:
a list with the following components:
acf:
a three-dimensional array containing the autocovariance or autocorrelation
function estimates.
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.
lag:
an array the same shape as 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.
n.used:
the number of observations in which no missing values occur.
type:
a character string indicating the type of function,
"covariance", "correlation" or "partial".
series:
the name of x, including transformations.
SIDE:
if plot is TRUE, a high density plot (type="h") of the resulting function
will be produced including the 95% confidence limits about zero.
DETAILS:
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.
BACKGROUND:
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.
REFERENCES:
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.