[Gretl-devel] differences in xcorrgm and corr function
Allin Cottrell
cottrell at wfu.edu
Mon Mar 3 14:21:22 EST 2008
On Mon, 3 Mar 2008, Ignacio Diaz-Emparanza wrote:
> 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...
> Now I see that the same occurs with the correlogram.
That's right, the values from corrgm and xcorrgm will not be the
same as those given by "corr" in small samples. In this respect
we're in agreement with most other programs.
See
http://lists.wfu.edu/pipermail/gretl-users/2004-April/000022.html
They are, however, asymtotically equivalent:
nulldata 1000
setobs 1 1 --time
series x = normal()
series y = normal()
diff x y
xcorrgm d_x d_y
scalar c0=corr(d_x,d_y)
scalar cm1=corr(d_x(-1),d_y)
scalar c1=corr(d_x,d_y(-1))
scalar c2=corr(d_x,d_y(-2))
corrgm d_x
scalar cx1=corr(d_x,d_x(-1))
scalar cx2=corr(d_x,d_x(-2))
Allin.
More information about the Gretl-devel
mailing list