// Dynare Code For Bianca De Paoli (2009) //============================================================= // First introduce the endogenous variables in the equations: var pih x y ynat rnat r s pi de pistar a g u c cstar; //============================================================= // List the exogenous variables in the model: varexo cstar_ a_ g_ u_ ; //============================================================= // First list the parameters and then assign them a value parameters uss taoo gs rho rhor tau lambda beta r_pi r_x rhoa rhoy theta alpha rho_eb cros circle tau_a tau_star kapa_eb rhog rhogstar rhou tau_u tau_g ; // Assign values - Calibration rho = 0.9985; // Coefficient of risk aversion. eta= 0.4707; // Labor supply elasticity lambda = 0.31; // Degree of openess beta = 0.98; // Discount factor rhor = 0.9; // Interest rate smoothing r_pi = 1.5; // Response to inflation in the Taylor rule r_x = 0.5; // Response to output gap in the Taylor rule rhoa = 0.4; // AR1 parameter for the technology shock rhoy = 0.7; // AR1 parameter for the world output shock rhog = 0.45; // AR1 parameter for the SOE governemnt spending rhogstar = 0.66; // AR1 parameter for the foreign governemnt spending rhou = 0.5; // AR1 parameter for the markup shock theta = 0.8645; // Elasticity of substitution between home and foreign goods alpha= 0.39; //Calvo price setting firms u_ss=1/(1-lambda); rho_eb = rho/((1-lambda)*(theta+1-lambda)); cros = (1-lambda)*(theta*rho-1+lambda); circle = (1-lambda)*rho_eb; tau_a = (1+eta)/(rho_eb+eta); tau_star =-(rho-rho_eb)/(rho_eb+eta); kapa_eb=((1-alpha*beta)*(1-alpha)*(rho_eb+eta))/(alpha); tau_u=(-1/(eta+rho_eb)); tau_g=(-1+rho_eb)/(eta+rho_eb); sigma=6; gs= ln(sigma-1) - ln(sigma) - ln(1-lambda); taoo=(-1)*((u)/(eta+rho_eb)); //============================================================= // Declaration of the model - log linear model(linear); //1 new IS Curve of SOE, eq.(4.70) x = x(+1) - (1/rho_eb)*( r - pih(+1) - rnat) ; //2 def. of nature rate of interest rate of SOE eq(4.74) rnat = (cstar(+1)-cstar)* ((cros*rho_eb-lambda*rho+tau_star*rho_eb)/(1-lambda)) + rho_eb*tau_g*(g(+1)-g) - rho_eb*(g(+1)-g) + rho_eb*tau_a*(a(+1)-a) ; //3 etalips Curve of the SOE, section (4.7.2.3) pih = beta * pih(+1)+ kapa_eb*x + (((1-alpha*beta)*(1-alpha))/(alpha))*u; //4 def. of nature level of output of SOE, eq.(4.63) ynat = tau_a*a + +tau_g*g + tau_star*(cstar) + taoo; //5 def. of output gap of SOE, eq (4.64) x = y - ynat; //6 mothetanry policy rule, 2 alternatives, eq (4.75) and (4.76) r = rhor*r(-1)+r_pi*pi+r_x*x; %de=0; //7 wedge between domestic and world output, eq.(4.59) y = cstar + rho_eb^(-1)*s + g; //8 wedge (gap) between domestic and CPI inflation, eq. (4.47) pi = pih + (1-lambda)*(s-s(-1)); //9 TOT, first difference of eq.(4.49) s = s(-1) + de + pistar - pih; //10 foreign inflation is set to be zero pistar = 0; //11 exogenous process of productivity in SOE (Section 4.2 - Production sector) a = rhoa*a(-1) + a_; //12 exogenous process of world output (Section 4.1.3) cstar = rhoy*cstar(-1) + cstar_; //13 exogenous process of gov spending in SOE (Section 4.1.3) g = rhog*g(-1) + g_; //15 exogenous process of markup (Section 4.2.1 - Price setting mechanism) u = rhou*u(-1) + u_; //16 Aggregate demand of domestic goods (equation below 4.29 or 4.56) y = (1-lambda)*c + lambda*cstar + theta*(1-lambda)*s + g; end; //============================================================= // Ask dynare to check the steady state (here we do not give initial conditions as the model is log linearized) steady; check; //================================================ // Define the shocks and their variability shocks; var a_ = 0.00255^2; //the SD of productivity var cstar_ = 0.0277^2; //the SD of world output var u_ = 0.0013^2; //the SD of productivity var g_ = 0.0056^2; //the SD of productivity end; //================================================ // Solve the model with the shocks introduced //stoch_simul (irf = 20) a r y ynat x pi pih s de c rnat; stoch_simul (irf = 20,nograph) x pih s y c ; stoch_simul(order=1,irf=0,noprint) y x pih; y_pos=strmatch('y',var_list_ ,'exact'); x_pos=strmatch('x',var_list_ ,'exact'); pih_pos=strmatch('pih',var_list_ ,'exact'); r_pi_vec=[1.5 1.5 5 1.5]; r_x_vec=[0.125 0 0 1]; variance.x=NaN(1,length(r_pi_vec)); variance.y=NaN(1,length(r_pi_vec)); variance.pi=NaN(1,length(r_pi_vec)); L=NaN(1,length(r_pi_vec)); for ii=1:length(r_pi_vec) set_param_value('r_pi',r_pi_vec(ii)); set_param_value('r_x',r_x_vec(ii)); [info, oo_, options_] = stoch_simul(M_, options_, oo_, var_list_); %loop over stoch_simul if ~info(1) %read out current parameter values par.lambda=M_.params(strmatch('lambda',M_.param_names,'exact')); par.theta=M_.params(strmatch('theta',M_.param_names,'exact')); par.sigma=M_.params(strmatch('sigma',M_.param_names,'exact')); par.alpha=M_.params(strmatch('alpha',M_.param_names,'exact')); par.beta=M_.params(strmatch('beta',M_.param_names,'exact')); par.rho=M_.params(strmatch('rho',M_.param_names,'exact')); par.eta=M_.params(strmatch('eta',M_.param_names,'exact')); par.lambdaa=(1-alpha)*(1-beta*alpha)/alpha; par.omega_pi= sigma/(((1-alpha*beta)*(1-alpha))/alpha); par.omega_y=rho+eta; par.rho_eb = rho/((1-lambda)*(theta+1-lambda)); par.omega_y=eta+1; par.omega_pi=(sigma*(1-alpha)*(1-beta*alpha))/alpha; x_t(ii)=oo_.var(x_pos); variance.x(ii)=oo_.var(x_pos,x_pos); variance.y(ii)=oo_.var(y_pos,y_pos); variance.pih(ii)=oo_.var(pih_pos,pih_pos); L(ii)=(1-par.lambda)*(0.5*(par.omega_y*variance.x(ii)+par.omega_pi*variance.pih(ii))+(1-par.rho_eb)*x_t(ii)); end end //Print result labels={'r_pi';'r_x';'sigma(y)';'sigma(tilde y)';'sigma(pi)';'L'}; headers={' ';' ';' ';' '}; values=[r_pi_vec;r_x_vec;sqrt(variance.y);sqrt(variance.x);sqrt(variance.pih);L]; options_.noprint=0; dyntable(options_,'Technology',headers,labels,values,size(labels,2)+2,4,10) options_.noprint=1;