/* ********************************************************************* */ /* CHAPITRE 11 - MODELES A EQUATIONS SIMULTANEES */ /* ********************************************************************* */ libname exo 'Z:\Econometrie appliquee\donnees'; ods pdf file="Z:\Econometrie appliquee\Resultats\chapitre11.pdf"; title; * ----------------------------------------------------------------------- ; * q : production bovine ; * ctot : consommation totale ; * p : prix à la production du boeuf (francs constants 70) ; * pb : prix à la consommation du boeuf (fc 70) ; * w : prix des aliments du bétail (fc 80) ; * B : solde du commerce extérieur ; * s : niveau des stocks publics en fin d'année ; * pm : prix à la consommation du mouton (fc 80) ; * ipc : indice des prix à la consommation finale (fc 70) ; * R : revenu dispo du revenu des ménages français (francs courants) ; * pop : niveau de population française au 1er janvier ; * ----------------------------------------------------------------------- ; * *********************************************************************** ; * Problème n°11.1 : construction des variables et analyse descriptive ; * *********************************************************************** ; * Point 1 : transformation des indices de prix (ref 1990) ; * ------------------------------------------------------- ; data chapit11; set exo.chapit11; * Année de référence : 1990 ; p90 = p / 313.48 * 100; w90 = w / 140.88 * 100; pb90 = pb / 469.41 * 100; pm90 = pm / 378.34 * 100; ipc90 = ipc / 468.38 * 100; run; * Point 2 construction des variables ; * ---------------------------------- ; data chapit11b; set chapit11; pb = pb90 / ipc90; * rapport de prix du boeuf / prix à la conso; pm = pm90 / ipc90; * rapport de prix du mouton / prix à la conso; c = ctot / pop; * Consommation de viande bovine par tête; r = r*100 / ipc90 / pop; * Revenu disponible par tête ; pr = p90 / ipc90; * Rapport prix du boeuf à la prod / prix à la conso; run; * Point 3 : ecriture de l'equation comptable ; * ------------------------------------------ ; data chapit11b; set chapit11b; eqc = ctot + B +(s - lag(s)); * EQC = Conso totale +Solde du commerce ext +(niveau de stock en n - niveau de stock en n-1) ; dif = EQC - q; run; * Point 4 : analyse graphique des variables ; * ----------------------------------------- ; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1961 to 1997 by 3) width=1 value=(h=1); axis2 label=none order=(1300 to 2000 by 100) width=1 value=(h=1) color=black; proc gplot data=chapit11b; title "Evolution de la consommation totale et de la production"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (ctot q)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; axis3 label=none order=(0 to 150 by 25) width=1 value=(h=1) color=black; proc gplot data=chapit11b; title "Evolution des indices de prix du boeuf et du mouton (base : 1990)"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (pb90 pm90)*an / overlay legend=legend1 haxis=axis1 vaxis=axis3; run; quit; * ******************************************************************* ; * Problème n°11.2 : estimation du modèle ; * ******************************************************************* ; * Point 1 : construction des variables necessaire à la modelisation ; * ----------------------------------------------------------------- ; data chapit11b; set chapit11b; if an=1974 then d74=1; else d74=0; q1 = lag1(q); w1 = lag1(w90); c1 = lag1(c); p1 = lag1(p90); p2 = lag2(p90); p3 = lag3(p90); s1 = lag1(s); run; * Point 3 : estimation du modele equation par equation ; * ---------------------------------------------------- ; * Selection de la periode d'analyse ; * --------------------------------- ; data extract11; set chapit11b; if an in(1961,1962,1963) then delete; if an in(1996,1997,1998) then do; q=.; c=.; b=.; end; run; * Equation d'offre estimee par la methode des MCO ; * ----------------------------------------------- ; proc reg data=extract11 simple; model q = p1 p2 p3 q1 w1 d74 / dw ; run; quit; * Calcul du h de Durbin : h=(1-d/2)*(racine[t/(1-t*(var(q1)))]) ; * h = (1-2,091/2)*(racine[32/(1-32*(0,16723*0,16723))]) = -0,79 ; * cette valeur est inférieure à 1,64 => absence d'autocorrélation ; * des erreurs (on accepte H0) ; * Equation de demande estimee par la methode des DMC ; * -------------------------------------------------- ; proc syslin data=extract11 2sls; instruments p1 p2 p3 q1 w1 d74 c1 pm r s s1; model c = pb pm r c1; run; * Equation de marge estimee par la methode des DMC ; * ------------------------------------------------ ; proc syslin data=extract11 2sls; instruments p1 p2 p3 q1 w1 d74 c1 pm r s s1; model pb = pr; run; * Equation du commerce exterieur estimee par la methode des MCO ; * ------------------------------------------------------------- ; proc reg data=extract11; model B = s1 /dw; run; quit; * Calcul du h de Durbin : h=(1-d/2)*(racine[t/(1-t*(var(s1)))]) ; * h = 1,787 > 1,64 => présence d'autocorrélation des erreurs ; * (rejet de H0) ; * Point 4 : estimation des equations simultanement (TMC) ; * ------------------------------------------------------ ; proc syslin data=extract11 3sls out=res outest=parametre; instruments p1 p2 p3 q1 w1 d74 c1 pm r s s1; offre : model q = p1 p2 p3 q1 w1 d74; output p = q_offre; demand : model c = pb pm r c1; output p = c_demand; marge : model pb = pr; output p = pb_marge; solde : model B = s1; output p = B_solde; run; * ******************************************************************* ; * Problème n°11.3 : qualité prédictive du modèle et simulation ; * ******************************************************************* ; * Point 1 : simulation statique du modele ; * --------------------------------------- ; data predict (keep=an q_offre c_demand pb_marge B_solde); set res; run; data simulation; merge predict chapit11b; by an; if an in(1961,1962,1963) then delete; run; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(1300 to 2000 by 100) width=1 value=(h=1) color=black; proc gplot data=simulation; title "Comparaison de la production observee et simulee"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (q q_offre)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(25 to 34 by 1) width=1 value=(h=1) color=black; proc gplot data=simulation; title "Comparaison de la consommation observee et simulee"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (c c_demand)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(0.925 to 1.075 by 0.025) width=1 value=(h=1) color=black; proc gplot data=simulation; title "Comparaison du prix a la conso observe et simule"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (pb pb_marge)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(-100 to 250 by 50) width=1 value=(h=1) color=black; proc gplot data=simulation; title "Comparaison du solde du commerce ext. observe et simule"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (b B_solde)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; * Point 2 : simulation dynamique du modele ; * ---------------------------------------- ; proc syslin data=extract11 3sls out=res outest=parametre2; instruments p1 p2 p3 q1 w1 d74 c1 pm r s s1; offre : model q = p1 p2 p3 q1 w1 d74; demand : model c = pb pm r c1; marge : model pb = pr; solde : model B = s1; identity s = q - ctot - B + s1; run; proc simlin data=extract11 est=parametre2 type=3sls; endogenous q c pb B s; exogenous p1 p2 p3 w1 d74 pr pm r ctot; lagged q1 q 1 c1 c 1 s1 s 1; output out=predict_dyn p=q2_offre c2_demand pb2_marge B2_solde s2_pred; run; data dynamique; merge predict_dyn chapit11b; by an; if an in(1961,1962,1963) then delete; run; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(1300 to 2000 by 100) width=1 value=(h=1) color=black; proc gplot data=dynamique; title "Comparaison de la production observee et simulee"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (q q2_offre)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(25 to 34 by 1) width=1 value=(h=1) color=black; proc gplot data=dynamique; title "Comparaison de la consommation observee et simulee"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (c c2_demand)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(0.925 to 1.075 by 0.025) width=1 value=(h=1) color=black; proc gplot data=dynamique; title "Comparaison du prix a la conso observe et simule"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (pb pb2_marge)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; goption reset=global; legend1 frame across=1 mode=share position=(top left) offset=(10 pct, -8 pct) cshadow=grey; axis1 label=none order=(1963 to 2000 by 3) width=1 value=(h=1); axis2 label=none order=(-100 to 300 by 50) width=1 value=(h=1) color=black; proc gplot data=dynamique; title "Comparaison du solde du commerce ext. observe et simule"; symbol1 value=none color=blue i=join; symbol2 value=none color=red i=join; plot (b B2_solde)*an / overlay legend=legend1 haxis=axis1 vaxis=axis2; run; quit; ods pdf close;