warning off var ////////////////////////////////////////////// // Endogenous Variables // ////////////////////////////////////////////// // c //1.Aggregate Consumption infc //2.CPI intr //3.Nominal Interest Rate k //4.Capital wk //5.Rental Rate of Capital z //6.Capital Utilization Rate cu //7.Utility Consumption ce //8.Energy Consumption cp //9.Petrol Consumption pu //10.Price of utilities pp //11.Price of petrol pc //12. s //13.Exchange Rate bf //14.Foreign Bond Purchases infw //15.Wage inflation w //16.Wage Rate mrs //17.Marginal Rate of Substitution h //18. q //19.Non-Energy Output B //20.Non-Energy Bundle of Value Added cn //21.Non-Energy Consumption e //22. vn //23.value added mn //24.Imported Non-Energy Input Ip //25.Petrol Input Iu //26. Utility Input mu //27.Mark-up pvc //28. Competitive Price of Value Added pm //29. Price of Imports infn //30. Inflation in Non-Energy Goods v //31. Aggregate Value added qp //32. Petrol Sector Output Io //33. Input vp //34. Petrol Sector Value Added infpb //35. Petrol Sector Inflation mup //36. Petrol Sector Marginal Cost po //37. Price of Input - Petrol Sector ppb //38. Price infu //39. Utility Inflation muu //40. Utility Marginal Cost pg //41. Price Ig //42. infm //43. Import Inflation xn //44. Export of non-energy,net xo //45. xg //46. vu //47. Utility Value Added qu //48. Utility output.// Total Number of Endogenous Model Variables: 48 //y // //x // /////////////////////////////////// // Shocks // /////////////////////////////////// // epsa //49.productivity shock epsb //50.Risk Premium Shock epsg //51.domestic demand shock epsi //52.monetary policy Shock epsinv //53. Investment-specific technology Shock epsmu //54.price Mark-up Shock epspg //55.Shock to World Gas Prices epspmf //56.shock to the world price of domestic imports epspo //57.Shock to World Oil Prices epsrf //58.World Real Interest Rate Shock epsw //59.Wage mark-up Shock epsyf; //60.world demand shock //////////////Total no. of Shocks: 12. varexo ////////////////////////////////////////////// // Exogenous Variables // ////////////////////////////////////////////// // kappaa //1.productivity shock kappab //2.risk premium shock kappag //3.domestic demand shock kappai //4.monetary policy shock kappainv //5.investment-specific technology shock kappamu //6.price mark upshock kappapg //7.gas price shock kappapmf //8.world export prices shock kappapo //9.oil price shock kapparf //10.world interest rate shock kappaw //11.wage mark up shock kappayf; //12.world demand shock ////////////// Total no. of Shock Variances: 13 parameters ////////////////////// // Parameters // ///////////////////////////////////////////////////////////////////////////////////// // beta delta xsiz xsibf sigmaw sigmae sigmap sigmav sigmaq // psip psie kappaz alfaq alfab alfav psin psiqp psiu psid //Total Number of Fixed Parameters: 19 PC1 PC2 PC3 V1 V2 V3 QP1 QP2 QU1 QU2 IO1 IG1 Q1 Q2 Q3 Q4 Q5 Q6 BF1 BF2 BF3 BF4 BF5 //Total Number of Steady State Implied Market Clearing Coefficients: 23 psih sigmac xsik epsk phiz psiw psiwc sigmah zetaw xsip // xsiu xsipp epsp epsu epspp psix psipm epspm tetapdot tetay tetarg //Total Number of Estimated Parameters: 21 rhorf rhopg rhopo rhopmf rhoyf rhow rhoinv rhomu rhoi rhog rhob rhoa; //Total Number of Shock Persistence Parameters: 12 // ///////////////////////////////////////////////////////////////////////////////////// load coef // beta=0.9925; //Discount Factor // delta=0.013; //Depreciation Rate // xsiz=0.0206; //Scales the Effect of Capital utilization // xsibf=0.001; //Cost of Adjusting Portfolio of Foreign Bonds // sigmaw=coef(1,23); //Elasticity of Demand for Differentiated Labor // sigmae=0.4; //Elasticity of Substitution Between Non-Energy and Energy Consumption // sigmap=0.1; //Elasticity of Substitution Between Petrol and Utilities in Energy Consumption // sigmav=0.5; //Elasticity of Substitution Between Labor and Capital in Value-Added Production // sigmaq=0.15; //Elasticity of Substitution Between Energy and Everything Else in Non-Energy Production // psip=0.5913; //Share of Petrol in Energy Consumption // psie=0.0526; //Share of Energy in Consumption // alfaq=0.1;//0.0528; //Cost Share of Energy in Non-Energy Output // alfab=0.08;//0.3154; //Cost Share of Imports in 'Bundle' // alfav=0.1701; //Cost Share of Capital in Value-Added // psin=0.3096; //Cost Share of Petrol in Energy Output // psiqp=0.1844; //Cost Share of Value-Added in Petrol Output // psiu=0.4834; //Cost Share of Value-Added in Utilities Output // psid=0.617; //Share of Duty in Petrol Prices // // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Steady-State Implied Fixed Ratios - Parameters // ///////////////////////////////////////////////////////////////////////////23 // PC1=0.9474; // PC2=0.0215; // PC3=1-PC1-PC2; // // V1=0.9815; // V2=0.0145; // V3=1-V1-V2; // // QP1=0.4204; // QP2=1-QP1; // // QU1=0.4054; // QU2=1-QU1; // // IO1=0.4551; // IG1=-0.0792; // // Q1=0.5802; // Q2=4.702; // Q3=(1-delta)*Q2; // Q4=0.0206*Q2; // Q5=0.2552; // Q6=0.1032; // // BF1=1/beta; // BF2=0.2552; // BF3=-0.0007; // BF4=0.0035; // BF5=0.2851; // // /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // Estimated Parameters //21+12 ////////////////////////////////////////////////////////////////////////////////////////////////////// // // tetay=coef(1,1); //Taylor Rule Coefficient on Value-added // epsp=coef(1,2); //Degree of Indexation: non energy sector // xsip=coef(1,3); //Probability of Not Being Able to Change Price: non energy sector // epspm=coef(1,4); //Degree of Indexation: importers // psipm=coef(1,5); //Probability of not being able to change price: importers // kappaz=coef(1,6); //Elasticity of Demand for Exports // psix=coef(1,7); //Degree of persistence in export demand // psih=coef(1,8); //Degree of Habit Persistence in Consumption // sigmac=coef(1,9); //Intertemporal Elasticity of Substitution // epsk=coef(1,10); //Degree of Persistence in Investment Adjustment Costs // zetaw=coef(1,11); //Degree of Wage Indexation // psiw=coef(1,12); //Probability of Being Able to Change Wages // sigmah=coef(1,13); //Frisch Elasticity of LAbor Supply // tetarg=coef(1,14); //Degree of interest rate smoothing in Taylor Rule tetapdot=coef(1,15); //Taylor rule coefficient on inflation // xsik=coef(1,16); //Scale of Capital Adjustment Costs // psiwc=coef(1,17); //Share of Wage Bill Paid Financed by Borrowing // xsiu=coef(1,18); //Probability of Not being able to change price: utilities // xsipp=coef(1,19); //Probability of not being able to change price: petrol // epsu=coef(1,20); //Degree of Indexation: utilities sector // epspp=coef(1,21); //Degree of Indexation: petrol sector // phiz=coef(1,22); //Inverse Elasticity of Capital Utilization // ////////////////////////////////////////////////////////////////////////////// load rhocoef rhorf=rho(1,10); // rhopg=rho(1,7); // rhopo=rho(1,9); // rhopmf=rho(1,8); // rhoyf=rho(1,12); // rhow=rho(1,11); // rhoinv=rho(1,5); // rhomu=rho(1,6); // rhoi=rho(1,4); // rhog=rho(1,3); // rhob=rho(1,2); // rhoa=rho(1,1); // load stds stda=rho(1,1); // stdb=rho(1,2); // stdg=rho(1,3); // stdi=rho(1,4); // stdinv=rho(1,5); // stdmu=rho(1,6); // stdpg=rho(1,7); // stdpmf=rho(1,8); // stdpo=rho(1,9); // stdrf=rho(1,10); // stdw=rho(1,11); // stdyf=rho(1,12); // ////////////////////////// model(linear); c=((psih*(1-sigmac))/(1+psih*(1-sigmac)))*c(-1)+(1/(1+psih*(1-sigmac)))*c(+1)-(sigmac/(1+psih*(1-sigmac)))*(intr-infc(+1)-((1/beta)-1)+epsb); //1. (intr-infc(+1)-((1/beta)-1)+epsb)=((epsk/(1-delta+xsiz))+(1+epsk))*xsik*k(-1)-(((1+epsk)/(1-delta+xsiz))+1)*xsik*k+(xsik/(1-delta+xsiz))*k(+1)-xsik*epsk*k(-2)+(xsiz/(1-delta+xsiz))*wk(+1)+epsinv; //2. wk=z*phiz; //3. ce=(1-psip)*cu+psip*cp; //4. c=(1-psie)*cn+psie*ce; //5. pu=(1/sigmae)*cn+((1/sigmap)-(1/sigmae))*ce-(1/sigmap)*cu; //6. pu-pp=-(1/sigmap)*cu+(1/sigmap)*cp; //7. s(+1)-s=-(intr-((1/beta)-1)+epsb)-xsibf*bf+epsrf; //8. //s(+1)-s=-(intr-((1/beta)-1))-xsibf*bf+epsrf; infw=(zetaw/(1+beta*zetaw))*infw(-1)+(beta/(1+beta*zetaw))*infw(+1)-((psiw*(1-beta*(1-psiw)))/((1+(sigmaw/sigmah))*(1-psiw)*(1+beta*zetaw)))*(w-mrs)+epsw; //9. mrs=(1/sigmah)*h+(1/sigmac)*(c+psih*(sigmac-1)*c(-1)); //10. w=infw+w(-1)-infc; //11. //infc=pc-pc(-1)+infn; //12. infc=0.8*infn+0.1*infu+0.1*infpb; //12. //Non-Energy Sector q=(1-alfaq)*B+alfaq*e+epsa; //13. Non-Energy Good Production Function B=(1-alfab)*vn+alfab*mn; //14. Bundle of Value Added Equation e=Ip; //15. Energy input equation Ip=Iu; //16. vn=mu-pvc+(1/sigmaq)*q+((sigmaq-1)/sigmaq)*B+((sigmaq-1)/sigmaq)*epsa; //17. Demand for value added mn=mu-pm+(1/sigmaq)*q-((1/sigmaq)-1)*B+((sigmaq-1)/sigmaq)*epsa; //18. Import Demand e=sigmaq*mu+q-sigmaq*(psin*pp+(1-psin)*pu)+(sigmaq-1)*epsa; //19. Energy demand infn=(beta/(1+beta*epsp))*infn(+1)+(epsp/(1+beta*epsp))*infn(-1)+(((1-xsip)*(1-beta*xsip))/((1+beta*epsp)*xsip))*mu+epsmu; //20. NKPC //Value Added Sector v=(1-alfav)*h+alfav*(k(-1)+z); //21. Value Added Production Function h=v+sigmav*(pvc-w-psiwc*(intr-((1/beta)-1)+epsb)); //22. Capital demand k(-1)+z=v+sigmav*(pvc-wk); //23. Labor Demand //Petrol Sector qp=Io; //24. Petrol Production Function Io=vp; //25. infpb=(beta/(1+beta*epspp))*infpb(+1)+(epspp/(1+beta*epspp))*infpb(-1)+(((1-xsipp)*(1-beta*xsipp))/((1+beta*epspp)*xsipp))*mup; //26. NKPC mup=psiqp*pvc+(1-psiqp)*po-ppb; //27. Marginal Cost Equation infpb=infn+ppb-ppb(-1); //28. Inflation definition //Utilities Sector qu=Ig; //29. Utility production function Ig=vu; //30. infu=(beta/(1+beta*epsu))*infu(+1)+(epsu/(1+beta*epsu))*infu(-1)+(((1-xsiu)*(1-beta*xsiu))/((1+beta*epsu)*xsiu))*muu; //31. NKPC muu=psiu*pvc+(1-psiu)*pg-pu; //32. Marginal Cost Equation infu=infn+pu-pu(-1); //33. Inflation definition //Monetary Policy intr-((1/beta)-1)=tetarg*(intr(-1)-((1/beta)-1))+(1-tetarg)*(tetapdot*infc+tetay*v)+epsi; //34. Taylor rule pp=(1-psid)*ppb; //35. price level //Foreign Sector infm=(beta/(1+beta*epspm))*infm(+1)+(epspm/(1+beta*epspm))*infm(-1)+(((1-psipm)*(1-beta*psipm))/((1+beta*epspm)*psipm))*(epspmf-s-pm); //36. NKPC po=epspo-s; //37. World price of oil pg=epspg-s; //38. World price of gas //xn=psix*xn(-1)-(kappaz*s)+epsyf; //39. Export demand xn=psix*xn(-1)-((1-psix)*(kappaz*s))+epsyf; //Market Clearing pc+c=PC1*cn+PC2*(pu+cu)+PC3*(pp+cp); //40. v=V1*vn+V2*vu+V3*vp; //41. qp=QP1*cp+QP2*Ip; //42. qu=QU1*cu+QU2*Iu; //43. Io=-IO1*xo; //44. Ig=-IG1*xg; //45. q=Q1*cn+Q2*k-(Q2*(1-delta))*k(-1)+(Q2*xsiz*z)+Q5*xn+epsg; //46. bf=BF1*bf(-1)+BF2*xn+BF3*(pg+xg)+BF4*(po+xo)+BF5*(pm+mn); //47. infm=pm-pm(-1)+infn; //pm=epspmf-s; //48. //y=0.9*q+0.03*qp+0.07*qu; //x=xn+xg+xo-mn; //AR shock processes; epsa=rhoa*epsa(-1)+kappaa; //49. epsb=rhob*epsb(-1)+kappab; //50. epsg=rhog*epsg(-1)+kappag; //51. epsi=rhoi*epsi(-1)+kappai; //52. epsinv=rhoinv*epsinv(-1)+kappainv; //53. epsmu=rhomu*epsmu(-1)+kappamu; //54. epspg=rhopg*epspg(-1)+kappapg; //55. epspmf=rhopmf*epspmf(-1)+kappapmf; //56. epspo=rhopo*epspo(-1)+kappapo; //57. epsrf=rhorf*epsrf(-1)+kapparf; //58. epsw=rhow*epsw(-1)+kappaw; //59. epsyf=rhoyf*epsyf(-1)+kappayf; //60. end; //steady; //check; shocks; // with the stand. dev of innovations from actual data var kappaa; stderr stda; var kappab; stderr stdb; var kappag; stderr stdg; var kappai; stderr stdi; var kappainv; stderr stdinv; var kappamu; stderr stdmu; var kappapg; stderr stdpg; var kappapmf; stderr stdpmf; var kappapo; stderr stdpo; var kapparf; stderr stdrf; var kappaw; stderr stdw; var kappayf; stderr stdyf; end; //stoch_simul(periods=100, order=1, irf=0, conditional_variance_decomposition=40)c,y,infn,z,e,w,intr,s; stoch_simul (noprint,nofunctions,nomoments,nocorr,irf=0); //stoch_simul(irf=40)c,y,infn,z,w,intr,s,e; //stoch_simul(irf=40); A=dr_.ghx; E=dr_.ghu; nvar=size(dr_.order_var,1); D=[zeros(nvar,dr_.nstatic) A(:,1:dr_.npred) zeros(nvar,dr_.nfwrd)]; D_k=A(:,27); save EDmatrix E D D_k; //AA=lgy_(dr_.order_var,:);