@ Green, Palmquist, and Schickler (1997). @ @ "Macropartisanship: A Replication and Critique" @ @ REVISED program to simulate fractionally integrated data @ @ see Fuller, p.100, column 2 @ @ concerning the AR effects of y_(t-k) on y_t @ d=.83; @ fractional integration parameter @ i=1; kappa=1; kapsum=0; v=1; rho=1; sig=1.8; let stackr[1,3]=. . .; @ this routine generates a series of AR and MA coefficients @ @ going back nlags in time @ nlags=400; do while i <= nlags; kappa=kappa*(1/i)*(i-1-d); v=v*(1/i)*(i-1+d); kapsum=kapsum+kappa; @ next line generates autocorrelations @ @ but won't work if i > 169 @ @rho=(gamma(i+d)*gamma(1-d))/(gamma(i-d+1)*gamma(d));@ @ delete the next comment to compare results to Fuller @ @print i~v~kappa~rho;@ stackr=stackr|(i~v~kappa); i=i+1; endo; print; print kapsum " sum of all AR coefficients"; stackr=trimr(stackr,1,0); theta=rev(stackr[.,2]); /* @ delete comment and add comment below to @ @ simulate the effects of a single disturbance @ u=zeros(1000,1); u[451,1]=1; */ u=sig*rndn(2000,1); q=1; let y[1,1]=.; @ generate a (0,d,0) series y @ do while q < rows(u)-rows(stackr); y=y|sumc(u[q:rows(stackr)+q,.] .* (theta|1)); q=q+1; endo; library pgraph; graphset; xy(seqa(1,1,rows(y)),y); y_out=y[2:1401,1]; screen off; output file=d.out reset; format /rd 8,5; y_out; output off; screen on;