Here's my first try to calculate a Cross Periodogram with Gretl. It's obviously
not perfect, but I think it is a bit useful. Maybe someone feels adressed to continue the
development for a cross spectral density or something else ...the values are (nearly) the
same as with Statistica.
_________________________________________________________
nulldata 200
#generate two related processes
series X=0
series Y=0
X=0.9*X(-1)+normal()
Y= 0.4*X + 0.75*Y(-1)+normal()
X1={ X }
Y1={ Y }
Fx=fft(X1)
Fy=fft(Y1)
#lambda = seq(1,($nobs/2))'.*(1/$nobs)
series a=Fx[,1]
series b=Fx[,2]
series c=Fy[,1]
series d=Fy[,2]
#Computes the cross-periodogram with x as a dependent
series crossxy_re=(a*c+b*d)/($nobs/2)
series crossxy_im=(b*c-a*d)/($nobs/2)
#Computes the cross-periodogram with y as a denpendent (imaginary part - the real part is
the same as with x as a dependent)
series crossyx_im=(d*a-c*b)/($nobs/2)
delete a b c d
_________________________________________________________
Kind regards
_________________________________________________________________
http://redirect.gimas.net/?n=M1001xFotos2
Dein Santa Claus hat rote Augen? Jetzt X-Mas-Fotos bearbeiten!