/* If I use theta=.3 proc statespace picks AR(1), now with theta=.9

   picks MA(1), notice that the F matrix is null when I write MA(1)

   as State Space Model. I wrote the restrictions after the first run.*/

ods html;

ods graphics on;

data ma;

     y1 = 0; a1 = 0;

     do i = -50 to 100;

        a = rannor( 32565 );

        y = y1 + a - .9* a1;

        if i > 0 then output;

        a1 = a;

        y = y1;

        end;

 

 

run;

 

data ma1;

set ma;

t=_n_;

run;

proc statespace data=ma1 out=out lead=10;

      var  y  ; id t; 

restrict F(2,1)=0 F(2,2)=0;

run;

 

data out1;

set out;

t=_n_;

run;

 

proc print data=out1;

      id t;

      where t > 50;

   run;

proc gplot data=out1;

      plot for1*t=1 y*t=2 /

           overlay href=200.5;

      symbol1 v=circle i=join;

  

      where t > 50;

   run;

 

ods graphics off;

ods html close;