Corrigé très peu de chagement par rapport à 3.2.4
title1 'Simulated ARIMA(1,1,1)'; data a; u1=0; u2=0 ; a1 = 0; do i = -50 to 100; a = 0.2*rannor(1); u = 0.1 + (5.0/3)*u1 - (2.0/3)*u2 + a + (5.0/6)*a1; if i > 0 then output; u2 = u1; u1 = u; a1 = a; end; run; symbol1 interpol=join color=black value=none; proc gplot data=a; plot u*i; run; title1 'arima (1,1,1)'; proc arima data=a; identify var=u;run; identify var=u(1); run; estimate p=1 q=1 METHOD=ML; run; quit;
Corrigé une ligne à ajouter dans le procedure arima
title1 'Simulated ARIMA(1,1,1)'; data a; u1=0; u2=0 ; a1 = 0; do i = -50 to 100; a = 0.2*rannor(1); u = 0.1 + (5.0/3)*u1 - (2.0/3)*u2 + a + (5.0/6)*a1; if i > 0 then output; u2 = u1; u1 = u; a1 = a; end; run; symbol1 interpol=join color=black value=none; proc gplot data=a; plot u*i; run; title1 'arima (1,1,1)'; proc arima data=a; identify var=u;run; identify var=u(1); run; estimate p=1 q=1 METHOD=ML; run; forecast id=i lead=20 out=arima_1_1_1; run; quit;Les resultats sont stockés dans la base de donnée
arima_1_1_1
,
prets à être exploités.
Corrigé On utilise la procedure gplot
.
\begin{verbatim} title1 'Simulated ARIMA(1,1,1)'; data a; u1=0; u2=0 ; a1 = 0; do i = -50 to 200; /* ici avec 100, l'estimation ne converge pas a = 0.2*rannor(1); u = 0.1 + (5.0/3)*u1 - (2.0/3)*u2 + a + (5.0/6)*a1; if i > 0 then output; u2 = u1; u1 = u; a1 = a; end; run; proc arima data=a; identify var=u;run; identify var=u(1); run; estimate p=1 q=1; run; forecast id=i lead=20 out=arima_1_1_1; run; quit; title1 'prevision arima (1,1,1)'; proc gplot data=arima_1_1_1; symbol1 i=join v=star h=1 cv=black ci=black co=black w=1; symbol2 i=join v=none h=3 cv=green ci=green co=green w=2; symbol3 i=join v=none h=3 cv=red ci=red co=red w=2; plot u*i=1 forecast*i=2 (l95 u95)*i=3 /overlay href=100; run; quit;
Corrigé
i=-50 to 200
, nous avons
vrai valeur | Estimation | |
AR(1) |
![]() |
1 - 0.711 B**(1) |
MA(1) |
![]() |
1 + 0.864 B**(1) |
c | 0.1 | 0.0639 |
![]() |
0.2 | 0.2136 |
Corrigé En prenant rannor(2) et i=-50 to 10000
,
vrai valeur | Estimation | |
AR(1) |
![]() |
1 - 0.6767 B**(1) |
MA(1) |
![]() |
1 + 0.8292 B**(1) |
c | 0.1 | 0.0926 |
![]() |
0.2 | 0.200 |
Corrigé Il y a pas grande chose à modifier par
rapport a 3.3.3. Il faut ajouter quelques options à la fonction plot
.
title1 'prevision arima (1,1,1)'; proc gplot data=arima_1_1_1; symbol1 i=join v=star h=1 cv=black ci=black co=black w=1; symbol2 i=join v=none h=3 cv=green ci=green co=green w=2; symbol3 i=join v=none h=3 cv=red ci=red co=red w=2; plot u*i=1 forecast*i=2 (l95 u95)*i=3 /overlay haxis = 950 to 1040 href = 1000; run; quit;