tseries (version 0.1-2)

pacf: Partial Autocorrelation Function

Description

Computes the sample partial autocorrelation function of `x` up to lag `lag`. If `pl` is `TRUE`, then the partial autocorrelation function and the 95% confidence bounds for strict white noise are also plotted. Missing values are not handled.

Usage

`pacf (x, lag = length(x) - 1, pl = TRUE, ...)`

Arguments

x
a numeric vector or time series.
lag
a scalar lag parameter.
pl
a logical indicating whether the partial autocorrelation function is plotted.
...
additional arguments to `plot.tsparam`.

Value

• A `"tsparam"` object.

Details

The partial autocorrelations are obtained from Yule-Walker estimates of the successive autoregressive processes. The algorithm of Durbin is used (see Box and Jenkins (1976), p. 65).

References

P. J. Brockwell and R. A. Davis (1991): Time Series: Theory and Methods, 2nd Edition, Springer Verlag, NY, pp. 98-102.

G. E. P. Box and G. M. Jenkins (1976): Time Series Analysis, Forecasting and Control, Holden-Day, San Francisco, pp. 64, 65.

`tsparam`

Examples

Run this code
``````n <- 1500
e <- rnorm (n, sd=2.25^2)  # Example 8.2.1 from Brockwell and Davies (1991)
x <- double (n)
x[1] <- 0
x[2] <- 0
for (i in 3:n)
{
x[i] <- 0.5*x[i-1]+0.2*x[i-2]+e[i]
}
x <- window(ts(x),start=501)
plot (x)
acf (x, 40, type="o", ylim=range(-1,1))
pacf (x, 40, type="o", ylim=range(-1,1))``````

Run the code above in your browser using DataCamp Workspace