Significance level of ACF and PACF in R

I want to get constraints that determine the value of autocorrelation coefficients and partial autocorrelation coefficients, but I do not know how to do this.

I got a partial autocorrelogram using this pacf(data) function. I want R to print me the values ​​shown in the figure.

enter image description here

+5
source share
3 answers

The limits determining the value of the autocorrelation coefficients are: +/- of (exp (2 * 1.96 / √ (N-3) -1) / (exp (2 * 1.96 / √ (N-3) +1) .

Here N is the length of the time series, and I used a confidence level of 95%.

+4
source

The correlation values ​​corresponding to the confidence intervals m % selected for the test are given by the expression 0 ± i/√N where:

N is the length of the time series

i is the number of standard deviations that we expect m % correlations lying inside under the null hypothesis that there is zero autocorrelation. Since the assumed correlations are considered normally distributed, for a confidence level of 95% (default acf ), i=2 . If you use a confidence level of, say, 99%, then i=3 , etc., As determined by the properties of the Gaussian distribution

Figure A1, Page 1011 here is a good example of how the principle above is applied in practice.

+2
source

After studying the acf and pacf functions, as well as the library psychometric with its CIz and CIr functions, I found this simple code to complete the task:

  • Calculate confidence interval for z Fisher:

     ciz = c(-1,1)*(-qnorm((1-alpha)/2)/sqrt(N-3)) 

here alpha is the level of confidence (usually 0.95). N is the number of observations.

  1. Calculate confidence interval for R:

     cir = (exp(2*ciz)-1)/(exp(2*ciz)+1 
0
source

All Articles