var Y L C CH CF K N D S Q W R RPR IR A X sh; varexo eirs, eA, eX, esh; parameters alfa A0 X0, gama, eta mu lev delta IR0, rhosh sigmash, rhoA rhoX rhoi, sigmaA sigmaX sigmai veta; alfa = 0.35; IR0 = 0.04; gama = 0.6; A0 = 0.540045; X0 = 11.2936; veta = 0.25; //robust economy: //lev=S*D/Q*K 1+eta=(QK/PN)^mu=(1-SD/QK)^-mu=(1-1/lev)^-mu //mu = 0.11; //lev = 6.00; //eta = 0.02; //delta = 1/((1+IR0)*(1+eta)); //=0.94 //vulnerable economy: mu = 0.02; lev = 1.20; eta = 0.04; delta = 1/((1+IR0)*(1+eta)); //=0.92 //shitty case //delta = 0.86; //mu = 0.016; //lev = 1.001; //eta = 0.12; rhoA = 0.8; sigmaA = 0.01; rhoX = 0.8; sigmaX = -0.01; rhoi = 0.5; sigmai = 0.01; rhosh = 0.5; sigmash = -0.01; model; exp(L) = 1; //(0) exp(Y) = exp(A)*exp(K(-1))^alfa*exp(L)^(1-alfa); //(1) exp(R)*exp(K(-1)) = alfa*exp(Y); //(2) exp(W)*exp(L) = (1-alfa)*exp(Y); //(3) exp(S)^(1-gama) = exp(Q); //(5) exp(CH)=gama*exp(W)*exp(L); //(6) exp(S)*exp(CF)=(1-gama)*exp(W)*exp(L); //(7) exp(N) + exp(S)*exp(D) = exp(Q)*exp(K); //(8) 1+RPR = (exp(Q)*exp(K)/exp(N))^mu; //(9) alfa*exp(Y(+1))*exp(S) = exp(K)*exp(Q)*exp(S(+1))*(1+IR)*(1+RPR); //(10) exp(N) = delta*(alfa*exp(Y)*exp(sh) - (1+IR(-1))*(1+RPR(-1))*exp(S)*exp(D(-1))); //(11) exp(Y) = gama*exp(Q)*(exp(C) + exp(K)) + exp(S)*exp(X); //(12) exp(Q)*exp(C)=exp(W)*exp(L); //(13) exp(A) = A0^(1-rhoA)*exp(A(-1))^rhoA*exp(sigmaA*eA); //(14) //A = log(A0); //(14) //exp(Q)*exp(K)/(exp(S)*exp(D))=lev; //Y=log(Y0); IR = (1-rhoi)*IR0 + rhoi*IR(-1) + sigmai*eirs; //(15) exp(X) = X0^(1-rhoX)*exp(X(-1))^rhoX*exp(sigmaX*eX); //(16) //X = log(X0); sh = rhosh*sh(-1) + sigmash*esh; //(17) //sh = 0; end; // puts some initial values initval; A = log(0.540045); C = log(1.60726); CF = log(7.07051); CH = log(0.195); D = log(7.35398); IR = 0.04; K = log(0.802416); L = log(1); N = log(0.0270424); Q = log(0.202207); R = log(0.218091); RPR = 0.036485; S = log(0.0183862); sh = 7.64018e-009; W = log(0.325); X = log(11.2936); Y = log(0.5); eirs=0; eA=0; eX=0; esh=0; end; steady; check; shocks; var eirs = 1; var eA = 1; var eX = 1; var esh = 1; end; // simulation: for deterministic case, simulation is done with Newton method: not an approximation //simul(periods=60); stoch_simul(order=2 , irf=30); //exp(dr_.ys(13)+dr_.ys(16)-dr_.ys(17))