/* This program graphs the ACF and PACF of an MA(1) process. For invertibility, -1 < theta1 < 1. */ data a; theta1= -0.8; /* You can change the value of theta1*/ do lag = 1 to 30; if lag = 1 then phijj=-theta1/(1+theta1**2); else if lag = 2 then phijj=-(theta1**2)/(1+theta1**2+theta1**4); else phijj=((-(theta1**lag))*(1-theta1**2))/(1-theta1**(2*(lag+1))); if lag = 1 then rho=-theta1/(1+theta1**2); else rho=0; output; end; run; symbol interpol=needle cv=blue ci=black value=dot height=1 width=1; proc gplot data=a; title1 'Theoretical ACF for MA(1) Process'; title2 'with theta1 = -0.8'; plot rho*lag; run; title1 'Theoretical PACF for MA(1) Process'; title2 'with theta1 = -0.8'; plot phijj*lag; run;