Dear developers,
We are often criticized for the use of fixed CI’s for ACF on correlograms, since the confidence band increases as the lag order increases. As seen on Wikipedia “Correlogram” page, the CI for ARIMA models looks like
[
\pm z_{1-\alpha/2}\sqrt{\frac{1}{N}\left(1+2\sum_{i=1}^{k} r_i^2\right)}
]
It is also mentioned in (Pankratz, A. 1983. Forecasting with univariate Box-Jenkins models: Concepts and cases). However, the currently implemented CI formula is ±1.96/T^{0.5}, so it is fixed. Please consider the code presented on StackExchange (implementation in R). I tried to rewrite it in hansl, but am not completely sure whether the implementation is correct.
<hansl> nulldata 200 setobs 4 1960:1 --time-series wn = randgen(n,0,1) phi = {0.6, 0.4, -0.2} theta = {5, -1.35, 0.275, 0.17, -0.04} matrix z = filter(wn, theta, phi) # ACF values acfsize = round($nobs/5) matrix t = cum(ones(acfsize,1)) matrix acfs = zeros(acfsize,1) loop k=1..acfsize scalar ends = $nobs - k scalar starts = 1 + k acfs[k] = corr(z[starts:$nobs],z[1:ends]) endloop # Bartlett errors matrix bartError = zeros(acfsize,1) bartError[1,] = $nobs^-0.5 # Use a for loop to fill the vector with the standard errors loop k=2..acfsize ends = k-1 bartError[k] = ((1 + 2*sum(acfs[1:ends,].*acfs[1:ends,]))^0.5)*($nobs^-0.5) endloop matrix plots = t~acfs~bartError gnuplot 3 2 1 --matrix=plots --output=display </hansl>
It is possible to add such an option to the corrgm command (fixed or Bartlett CI)?
Riccardo "Jack" Lucchetti
2014-05-21
On Wed, 21 May 2014, Andreï Victorovitch Kostyrka wrote:
We are often criticized for the use of fixed CI’s for ACF on
correlograms, since the confidence band increases as the lag order
increases. [...]
I personally don't think it makes much of a difference. All this stuff is
asymptotic anyway. However, it would be nice to give users the option.
By the way, the following script is a slight elaboration of yours, which
uses the same data as the example on the stackexchange page that you
linked in your original message:
<hansl>
set echo off
set messages off
nulldata 60
setobs 4 1955:1
pank_inv = {\
4.4, 5.8, 6.7, 7.1, 5.7, 4.1, 4.6, 4.3, 2.0, 2.2, 3.6, -2.2, \
-5.1, -4.9, 0.1, 4.1, 3.8, 9.9, 0.0, 6.5, 10.8, 4.1, 2.7, -2.9, \
-2.9, 1.5, 5.7, 5.0, 7.9, 6.8, 7.1, 4.1, 5.5, 5.1, 8.0, 5.6, \
4.5, 6.1, 6.7, 6.1, 10.6, 8.6, 11.6, 7.6, 10.9, 14.6, 14.5, 17.4, \
11.7, 5.8, 11.5, 11.7, 5.0, 10.0, 8.9, 7.1, 8.3, 10.2, 13.3, 6.2 \
}
series bus_inv = pank_inv'
acfsize = 14
matrix t = seq(1, acfsize)'
matrix acfs = corrgm(bus_inv,acfsize)
matrix tc = acfs[,1]
scalar isqT = 1.96/sqrt($nobs)
matrix bartError = isqT * sqrt(1 + 2*cum(tc.^2))
matrix plots = t ~ tc ~ bartError ~ -bartError
gnuplot 2 3 4 1 --matrix=plots --output=display --with-lines --single-yaxis
</hansl>
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti@univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
Ignacio Diaz-Emparanza
2014-10-09
It makes an important difference if the series you are applying the correlogram to is not a white noise. I think it should not be given as an option to the users, I think this should be the default option for any original series, but not for a series of residuals of an estimation. For residuals the confidence band should be the current ±1.96/T^{0.5}.
I also asked for this some time ago.