// Defining variables
var C I i_E K k_E L_H L_L l_H l_L Y V lambda_E M rK c_L c_E c_H w_L w_H q i_Z Z eta b_r AZ;
varexo e_x e_a;
parameters beta sigma omega sigma_1 sigma_2 gamma mu b_ss lambda delta_K phi_I
delta_Z A_ss AZ_ss psi_E psi_H psi_L Z_ss chiL chiH;
@# include "TFG_calibration.m"
model;
C=psi_H*c_H+psi_E*c_E+psi_L*c_L;
I=psi_E*i_E;
K=psi_E*k_E;
L_H=psi_H*l_H;
L_L=psi_L*l_L;
Y=C+I+M;
K=(1-delta_K)*K(-1)+I;
lambda_E=c_E^(-sigma);
lambda_E*(1+phi_I*(k_E-k_E(-1)))=beta*lambda_E(+1)*(rK+(1-delta_K)+phi_I*(k_E(+1)-k_E));
c_L=w_L*l_L;
c_H=w_H*l_H;
w_L=chiL*(l_L^(omega-1));
w_H=chiH*(l_H^(omega-1));
Y = A_ss*(((gamma^(1/sigma_1))*(K(-1)^((sigma_1-1)/sigma_1))+((1-gamma)^(1/sigma_1))*(V^((sigma_1-1)/sigma_1)))^(sigma_1/(sigma_1-1)));
V = ((mu^(1/sigma_2))*(L_L^((sigma_2-1)/sigma_2))+((1-gamma)^(1/sigma_2))*((b_r*Z(-1))^((sigma_2-1)/sigma_2)))^(sigma_2/(sigma_2-1));
rK = (A_ss^((sigma_1-1)/sigma_1))*(gamma^(1/sigma_1))*((Y/K(-1))^(1/sigma_1));
w_L = (A_ss^((sigma_1-1)/sigma_1))*((1-gamma)^(1/sigma_1))*(mu^(1/sigma_2))*((Y/V)^(1/sigma_1))*((V/L_L)^(1/sigma_2));
q = (A_ss^((sigma_1-1)/sigma_1))*((1-gamma)^(1/sigma_1))*((Y/V)^(1/sigma_1))*((1-mu)^(1/sigma_2))*((V/(b_r*Z(-1)))^(1/sigma_2))*b_r;
Z = (1-delta_Z)*Z(-1) + i_Z;
i_Z = AZ*(L_H^lambda)*(M^(1-lambda));
eta = beta*(lambda_E(+1)/lambda_E)*(q(+1)+(1-delta_Z)*eta(+1));
1 = AZ*eta*(1-lambda)*((L_H/M)^lambda);
w_H = eta*lambda*AZ*((L_H/M)^(-(1-lambda)));
// Shock process
b_r = b_ss + e_x;
AZ = AZ_ss + AZ_ss*e_a;
end;
initval;
C=C_ss;
I=I_ss;
i_E=iE_ss;
K=K_ss;
k_E=kE_ss;
L_H=L_H_ss;
L_L=L_L_ss;
l_H=l_H_ss;
l_L=l_L_ss;
Y= Y_ss;
lambda_E=lambdaE_ss;
M=M_ss;
rK=rk_ss;
c_L=c_L_ss;
c_E=cE_ss;
c_H=c_H_ss;
w_L=w_L_ss;
w_H=w_H_ss;
q=q_ss;
i_Z=Iz_ss;
Z=Z_ss;
eta=eta_ss;
b_r=b_ss;
V=V_ss;
AZ=AZ_ss;
end;
steady;
xx= [0.001:0.001:0.1];
yy= [0.01:-0.0001:0.0001]./5.05;
tt=cumsum(yy);
shocks; // please consider one shock at the time (taking in/out the // sign)
// var e_x; // shock to b
// periods 1:100 101:10000;
// values (tt) 0.1;
var e_a; // shock to AZ
periods 1:100 101:10000;
values (tt) 0.1;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% Initialization %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
horizon=100;
tt=[0:horizon];
stoch_simul;
figure(1)
subplot(4,2,1)
plot(tt,[b_ss; b_r(1:horizon)],'.-b')
hold on
hold off
legend('b')
subplot(4,2,2)
plot(tt,[w_H_ss; w_H(1:horizon)],'.-b')
hold on
%plot(tt,[w_L_ss; w_L(1:horizon)],'--r')
hold off
legend('w_H')
subplot(4,2,3)
%plot(tt,[w_H_ss; w_H(1:horizon)],'.-b')
hold on
plot(tt,[w_L_ss; w_L(1:horizon)],'.-b')
hold off
legend('w_L')
subplot(4,2,4)
plot(tt,[l_H_ss; l_H(1:horizon)],'.-b')
hold on
plot(tt,[l_L_ss; l_L(1:horizon)],'-r')
hold off
legend('l_H','l_L')
subplot(4,2,5)
plot(tt,[Y_ss; Y(1:horizon)],'.-b')
hold on
hold off
legend('Y')
subplot(4,2,6)
plot(tt,[Z_ss; Z(1:horizon)],'.-b')
hold on
hold off
legend('Z')
subplot(4,2,7)
plot(tt,[rk_ss; rK(1:horizon)],'.-b')
hold on
hold off
legend('rK')
subplot(4,2,8)
plot(tt,[eta_ss; eta(1:horizon)],'.-b')
hold on
hold off
legend('eta')
figure(2)
subplot(4,2,1)
plot(tt,[b_ss; b_r(1:horizon)],'.-b')
hold on
hold off
legend('b')
subplot(4,2,2)
plot(tt,[w_H_ss./w_L_ss; w_H(1:horizon)./w_L(1:horizon)],'.-b')
hold on
%plot(tt,[w_L_ss; w_L(1:horizon)],'--r')
hold off
legend('wage premium')
subplot(4,2,3)
plot(tt,[l_H_ss./l_L_ss; l_H(1:horizon)./l_L(1:horizon)],'.-b')
hold on
hold off
legend('Labor premium')
subplot(4,2,4)
plot(tt,[c_H_ss./c_L_ss; c_H(1:horizon)./c_L(1:horizon)],'.-b')
hold on
plot(tt,[cE_ss./c_H_ss; c_E(1:horizon)./c_H(1:horizon)],'--r')
hold off
legend('c_H/c_L','c_E/c_H')
subplot(4,2,5)
plot(tt,[cE_ss./c_L_ss; c_E(1:horizon)./c_L(1:horizon)],'.-b')
legend('c_E/c_L')
subplot(4,2,6)
plot(tt,[q_ss; q(1:horizon)],'.-b')
hold on
hold off
legend('q')
subplot(4,2,7)
plot(tt,[K_ss./L_L_ss; K(1:horizon)./L_L(1:horizon)],'.-b')
hold on
hold off
legend('K/L_L')
subplot(4,2,8)
plot(tt,[Z_ss./L_L_ss; Z(1:horizon)./L_L(1:horizon)],'.-b')
hold on
hold off
legend('Z/L_L')
figure(3)
subplot(4,2,1)
plot(tt,[AZ_ss; AZ(1:horizon)],'.-b')
hold on
hold off
legend('AZ')
subplot(4,2,2)
plot(tt,[w_H_ss; w_H(1:horizon)],'.-b')
hold on
%plot(tt,[w_L_ss; w_L(1:horizon)],'--r')
hold off
legend('w_H')
subplot(4,2,3)
%plot(tt,[w_H_ss; w_H(1:horizon)],'.-b')
hold on
plot(tt,[w_L_ss; w_L(1:horizon)],'.-b')
hold off
legend('w_L')
subplot(4,2,4)
plot(tt,[l_H_ss; l_H(1:horizon)],'.-b')
hold on
plot(tt,[l_L_ss; l_L(1:horizon)],'--r')
hold off
legend('l_H','l_L')
subplot(4,2,5)
plot(tt,[Y_ss; Y(1:horizon)],'.-b')
hold on
hold off
legend('Y')
subplot(4,2,6)
plot(tt,[Z_ss; Z(1:horizon)],'.-b')
hold on
hold off
legend('Z')
subplot(4,2,7)
plot(tt,[rk_ss; rK(1:horizon)],'.-b')
hold on
hold off
legend('rK')
subplot(4,2,8)
plot(tt,[eta_ss; eta(1:horizon)],'.-b')
hold on
hold off
legend('eta')
figure(4)
subplot(4,2,1)
plot(tt,[AZ_ss; AZ(1:horizon)],'.-b')
hold on
hold off
legend('AZ')
subplot(4,2,2)
plot(tt,[w_H_ss./w_L_ss; w_H(1:horizon)./w_L(1:horizon)],'.-b')
hold on
%plot(tt,[w_L_ss; w_L(1:horizon)],'--r')
hold off
legend('wage premium')
subplot(4,2,3)
plot(tt,[l_H_ss./l_L_ss; l_H(1:horizon)./l_L(1:horizon)],'.-b')
hold on
hold off
legend('Labor premium')
subplot(4,2,4)
plot(tt,[c_H_ss./c_L_ss; c_H(1:horizon)./c_L(1:horizon)],'.-b')
hold on
plot(tt,[cE_ss./c_H_ss; c_E(1:horizon)./c_H(1:horizon)],'--r')
hold off
legend('c_H/c_L','c_E/c_H')
subplot(4,2,5)
plot(tt,[cE_ss./c_L_ss; c_E(1:horizon)./c_L(1:horizon)],'.-b')
legend('c_E/c_L')
subplot(4,2,6)
plot(tt,[q_ss; q(1:horizon)],'.-b')
hold on
hold off
legend('q')
subplot(4,2,7)
plot(tt,[K_ss./L_L_ss; K(1:horizon)./L_L(1:horizon)],'.-b')
hold on
hold off
legend('K/L_L')
subplot(4,2,8)
plot(tt,[Z_ss./L_L_ss; Z(1:horizon)./L_L(1:horizon)],'.-b')
hold on
hold off
legend('Z/L_L')
What is the error message? I cannot run your code because you are including a file that is not provided.
I don´t get any error. The thing is that I want to do the shocks separately, first a shock to b (var e_x) and then a shock to AZ (var e_a) but I always get the same result. I attach both files TFG_base_2.mod (5.9 KB) TFG_calibration.m (1.9 KB)
I still don’t understand. When I run the file with the two different setting for the
@#define e_x_shock = 1
selector, I get very different results from the simulation.
TFG_base_2.mod (5.9 KB)
Thank you. now the graphs change, but the policy and transition functions are the same when I do the simulation (stoch_simul) are the same. Is that normal? I am new with dynare
At first order, policy functions are linear. So the presence of other shocks does not affect the IRFs to other shocks.
Thank you. What if I want to know the values of the variables in the short or long run? For example for period=5000
Sorry, but I don’t understand the question.