Library: | times |
See also: | pacfplot acf acfplot fft invfft |
Quantlet: | pacf | |
Description: | computes the (sample) partial autocorrelation function for the time series x. The output vector starts with the partial autocorrelation coefficient phi_1 at lag 1. The next entries are phi_2 ... phi_k. |
Usage: | y = pacf(x {, maxlag}) | |
Input: | ||
x | T x 1 vector of observed time series | |
maxlag | (optional) integer; maximum lag length that will be calculated, default value is 30 | |
Output: | ||
y | vector of sample partial autocorrelations with dimension 30 x 1 (default) or maxlag x 1. |
library("times") ; loads the quantlets from times library dax = read("dax.dat") ; monthly DAX 1979:1-2000:10 return = tdiff(log(dax)) ; generates the monthly return pac = pacf(return,12) pacsqr = pacf(return^2,12) pac~pacsqr ; output matrix
Contents of _tmp [ 1,] 0.036135 0.19351 [ 2,] 0.03197 -0.032352 [ 3,] -0.032397 0.071692 [ 4,] 0.014776 0.041088 [ 5,] -0.069044 0.030198 [ 6,] -0.045976 -0.053803 [ 7,] -0.011009 -0.030678 [ 8,] -0.017182 0.066633 [ 9,] -0.037066 0.027616 [10,] 0.13349 0.058726 [11,] 0.025715 -0.04407 [12,] 0.00055026 -0.049678 The sample partial autocorrelations with maximum lag length k = 12. We have T = 261 observations and thus the confidence bands are +/- 0.12. phi_10 of the DAX returns and phi_1 of the squared DAX returns lie outside these bands.