07.06.2013 Views

Guida all'uso di Gretl - Wake Forest University

Guida all'uso di Gretl - Wake Forest University

Guida all'uso di Gretl - Wake Forest University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Capitolo 5. Funzioni speciali in genr 41<br />

Esempio 5.4: Periodogramma usando la trasformata <strong>di</strong> Fourier<br />

nulldata 50<br />

# Genera un processo AR(1)<br />

series e = normal()<br />

series x = 0<br />

x = 0.9*x(-1) + e<br />

# Calcola il periodogramma<br />

scale = 2*pi*$nobs<br />

X = { x }<br />

F = fft(X)<br />

S = sumr(F.^2)<br />

S = S[2:($nobs/2)+1]/scale<br />

omega = seq(1,($nobs/2))’ .* (2*pi/$nobs)<br />

omega = omega ~ S<br />

# Confronto con il comando pergm<br />

pergm x<br />

print omega

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!