/* Simulation d'un processus AR(2): Y_t=phi1 Y_(t-1) + phi2 Y_(t-2) +e_t */ data a; lambda1 = 0.9; lambda2 = 0 ; phi1 = lambda1+lambda2 ; phi2 = -lambda1*lambda2 ; sig = 1 ; y1 = 0 ; y2 = 0 ; do t=1 to 200; y = phi1*y1 + phi2*y2 + sig*rannor(1) ; y2 = y1 ; y1 = y ; output ; end; run; proc print data=a (obs=1); var phi1 phi2; run; /* représentation graphique */ proc gplot data=a; symbol i=join; plot y*t; run; quit; /* Calculs des autocorrélations */ proc arima data=a; identify var=y ; run; /* Simulation d'un processus MA(2): Y_t=e_t + theta e_(t-1) + theta2 e_(t-2) */ data b; lambda1 = 0.9; lambda2 = 0 ; theta1 = -lambda1-lambda2 ; theta2 = lambda1*lambda2 ; sig = 1 ; e1 = 0 ; e2 = 0 ; do t=1 to 200; e = sig*rannor(1); y = e + theta1*e1 + theta2*e2 ; e2 = e1 ; e1 = e ; output ; end; run; proc print data=b (obs=1); var theta1 theta2; run; /* Représentation graphique */ proc gplot data=b; symbol i=join; plot y*t; run; quit; /* Calculs des autocorrélations */ proc arima data=b; identify var=y ; run; /* Simulation d'un processus ARMA(1,1): Y_t=phi1 Y_(t-1) + e_t - theta1 Y_(t-1) */ data c; phi1 = 0.8; theta1 = 0.3 ; sig = 1 ; e1 = 0 ; y1 = 0 ; do t=1 to 200; e = sig*rannor(1); y = phi1*y1 + e - theta1*e1 ; e1 = e ; y1 = y ; output ; end; run; proc print data=c (obs=1); var phi1 theta1; run; /* représentation graphique */ proc gplot data=c; symbol i=join; plot y*t; run; quit; /* Calculs des autocorrélations */ proc arima data=c; identify var=y ; run; quit;