arSimulation (1).doc

2
/*SAS examples */ /* Simulate white noise time series process with n=200*/ title "WN process"; data wn; do i=1 to 200; y=rannor(123); if i>0 then output; end; run; proc arima data=wn; identify var=y nlag=15; run; /* Simulate MA(1) time series process with n=200*/ title "MA1 process"; data ma1; etm1=rannor(123); do i=-50 to 200; et=rannor(123); yt=et+.9*etm1; if i>0 then output; etm1= e t; end; run; proc arima data=ma1; identify var=yt nlag=15; run; /* Simulate AR(1) time series process with n=200*/ title "AR1 process"; data ar1; ytm1=rannor(123); do i=-50 to 200; et=rannor(123); yt=0.9*ytm1+et; if i>0 then output;

description

arSimulation (1).doc

Transcript of arSimulation (1).doc

Page 1: arSimulation (1).doc

/*SAS examples*/

/* Simulate white noise time series process with n=200*/

title "WN process";

data wn;

do i=1 to 200;

y=rannor(123);

if i>0 then output;

end;

run;

proc arima data=wn;

identify var=y nlag=15;

run;

/* Simulate MA(1) time series process with n=200*/

title "MA1 process";

data ma1;

etm1=rannor(123);

do i=-50 to 200;

et=rannor(123);

yt=et+.9*etm1;

if i>0 then output;

etm1=et;

end;

run;

proc arima data=ma1;

identify var=yt nlag=15;

run;

 

/* Simulate AR(1) time series process with n=200*/

title "AR1 process";

data ar1;

ytm1=rannor(123);

do i=-50 to 200;

et=rannor(123);

yt=0.9*ytm1+et;

if i>0 then output;

Page 2: arSimulation (1).doc

ytm1=yt;

end;

run;

proc arima data=ar1;

identify var=yt nlag=15;

run;