[Gretl-devel] differences in xcorrgm and corr function

Ignacio Diaz-Emparanza ignacio.diaz-emparanza at ehu.es
Mon Mar 3 06:18:16 EST 2008


I was trying to recover some cross-correlations between two series and
I noticed that the command "xcorrgm" and the genr function "corr" do not give 
exactly the same estimations. 

I suppose they are using different formulas so I tried to look for the 
differences in the source (describe.c file) but I really do not find any 
difference, do you?

I think they should give the same result so if you run

scalar xy3=corr(y,x(-3)) 

you should obtain the same result as the xcorrgm gives for lag 3.

Now I see that the same occurs with the correlogram. For example

scalar x3=corr(x,x(-3)) 

is not exactly the same as the third coefficient that gives

corrgm d_Ct



<script>
open data3-6
diff Ct Yt
xcorrgm d_Ct d_Yt
scalar c0=corr(d_Ct,d_Yt) ;# this is the only one that coincides
scalar cm1=corr(d_Ct(-1),d_Yt)
scalar c1=corr(d_Ct,d_Yt(-1))
scalar c2=corr(d_Ct,d_Yt(-2))

corrgm d_Ct
scalar cx1=corr(d_Ct,d_Ct(-1))
scalar cx2=corr(d_Ct,d_Ct(-2))
</script>




-- 
Ignacio Diaz-Emparanza  
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)                                        
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es 



More information about the Gretl-devel mailing list