ar.yw(x, aic=T, order.max=<<see below>>)
First the autocovariance matrices of the time series are estimated and then Whittle's recursion (a multivariate extension of the Levinson-Durbin method) is used to estimate the autoregressive coefficients. The output may be used in spec.ar to estimate the spectrum of the process, or acf.plot to produce a plot of the partial autocorrelation function.
The estimation is performed using the sample mean of each univariate series as the estimate of the mean. Remember that the coefficients in ar are for the series with the mean(s) removed.
a <- ar.yw(log(lynx)) acf.plot(a, conf=T) # look at the partial correlations tsplot(a$aic) # and at the shape of Akaike's criteria. llynx.ar.fit <- ar.yw(log(lynx), aic=F, order=11) # Fit an AR(11).