/* This program generates some monte carlo data for use in the forecasting class. The first series is an invertible MA(1) process with theta1 = -0.9. The second series is an invertible MA(1) process with theta1 = 0.9. */ options pagesize=60 linesize=74 nodate; goptions device=win gsfname=plot rotate=landscape gsfmode=append target=hpljs3; *border; /* This segment of the program generates the invertible MA(1) model with theta1 = -0.9 */ data mc1; u1=0; a=-0.9; do t = 0 to 100; u=rannor(145923); y = 50 + u - a*u1; if t > 0 then output; u1=u; end; proc gplot data=mc1; symbol v=dot c=black i=join h=.8; title1 'Monte Carlo MA(1) data with theta(1) = -0.9'; title2 'X=Time Y=MA(1) Series'; axis1 order=(0 to 100 by 10) label=(f=duplex 'Obs'); axis2 order=(40 to 60 by 5) label=(f=duplex 'MA(1) Series'); plot y*t / haxis=axis1 vaxis=axis2; run; title ' Monte Carlo MA(1) data with theta(1) = -0.9'; proc arima data=mc1; identify var=y; run; /* This segment of the program generates the invertible MA(1) model with theta1 = 0.9 */ data mc2; u=0; a=0.9; do t = 0 to 100; u1=u; u=rannor(189763); y = 50 + u - a*u1; if t > 0 then output; end; proc gplot data=mc2; symbol v=dot c=black i=join h=.8; title1 'Monte Carlo MA(1) data with theta(1) = 0.9'; title2 'X=Time Y=MA(1) Series'; axis1 order=(0 to 100 by 10) label=(f=duplex 'Obs'); axis2 order=(40 to 60 by 5) label=(f=duplex 'MA(1) Series'); plot y*t / haxis=axis1 vaxis=axis2; run; title 'Monte Carlo MA(1) data with theta(1) = 0.9'; proc arima data=mc2; identify var = y; run;