I am trying to run a code but continue to get this response. “dynare-preprocessor.exe has stopped working” Could anyone let me know if they see an error in my code? I am not sure how to correct this if it is a bug.
var
c, % 1. Household consumption
l, % 2. Household labor effort; implicitly equal to firm labor demand
w, % 3. Real wage rate
r, % 4. Real rate of return on capital
k, % 5. Stock of physical capital; implicitly equal to firm capital demand
i, % 6. Investment in physical capital
y, % 7. GDP
z, % 8. Total factor productivity
g, % 9. Government spending
tau_c, % 10. Sales tax
tau_w, % 11. Labor income tax
tau_r, % 12. Capital gains tax
tau_y, % 13. Revenue tax
cy_ratio, % 14. BC properties, C/GDP ratio
iy_ratio, % 15. BC properties, I/GDP ratio
gy_ratio, % 16. BC properties, G/GDP ratio
ky_ratio, % 17. BC properties, K/GDP ratio
u, % 18. Period-t consumer utility
welf; % 19. Lifetime consumer utility
varexo eps_g, % Shock to government purchases
eps_z; % TFP shock
parameters sigma, chi, betta, delta, alpha, rho_g, rho_z, mu, tau, kappa, theta;
load Param.mat
sigma = param_sigma; % CRRA in consumer utility
chi = param_chi; % Elasticity of labor in utility
betta = param_betta; % Intertemporal discount factor
delta = param_delta; % Rate of capital depreciation
alpha = param_alpha; % Cobb-Douglas parameter
rho_g = param_rho_g; % Inertia in government spending
rho_z = param_rho_z; % Inertia in TFP
mu = param_mu; % Share of government purchases in GDP
tau = param_tau; % Varying level of tax rates
kappa = param_kappa; % Effect of government purchases on TFP
theta = param_theta; % Effect of government purchases on consumer utility
model;
% Household block
c^(-sigma)*(1-tau_w)*w/(1+tau_c) = l^chi;
betta*(c(+1)^(-sigma))*(1-tau_r(+1))*(1+r(+1)-delta)/(1+tau_c(+1)) = c^(-sigma)/(1+tau_c);
(1+tau_c)*c + k = (1-tau_w)*w*l + (1-tau_r)*(1+r-delta)*k(-1);
% Firm block
y = z*(k(-1)^alpha)*(l^(1-alpha));
log(z) = rho_z*log(z(-1)) + eps_z; % Original specification
% log(z) = rho_z*log(z(-1)) + (1-rho_z)*0.5*(g^kappa) + eps_z; % Alternative specification: benefit of government spending
(1-tau_y)*alpha*z*(k(-1)^(alpha-1))*(l^(1-alpha)) = r;
(1-tau_y)*(1-alpha)*z*(k(-1)^alpha)*(l^(-alpha)) = w;
% Government budget block
g = rho_g*g(-1) + (1-rho_g)*mu*y + eps_g;
tau_w*w*l + tau_r*(1+r-delta)*k(-1) + tau_c*c + tau_y*z*(k(-1)^alpha)*(l^(1-alpha)) = g;
tau_w = tau; % Set outside of the .mod file
tau_c = 0;
tau_y = 0;
% Notice that since tau_w is given and tau_c and tau_y are zero, the budget constraint in line 56 implicitly solves for tau_c
% Market cleearing block
y = c + i + g;
% Welfare block
% u = (c^(1-sigma))/(1-sigma) - (l^(1+chi))/(1+chi); % Original specification
u = (c^(1-sigma))/(1-sigma) - (l^(1+chi))/(1+chi) + (2*g)^theta; % Alternative specification: benefit of government spending
welf = u + betta * welf(+1);
% Auxiliary variables
cy_ratio = c/y;
iy_ratio = i/y;
gy_ratio = g/y;
ky_ratio = k/y;
end;
shocks;
var eps_g = 0.01;
var eps_z = 0.01;
var eps_g,eps_z = 0;
end;
initval;
z = 1; % True solution in the original specification; a reasonable guess in the extended model
tau_w = tau;
tau_c = 0;
tau_y = 0;
r = (1/(betta*(1-tau_r))) - 1 + delta;
c = 2;
l = 2;
k = 3;
w = 1.5;
y = z*(k^alpha)*(l^(1-alpha));
g = mu*y;
i = y - c - g;
tau_r = (g-tau_w*w*l)/((1+r-delta)*k);
% u = (c^(1-sigma))/(1-sigma) - (l^(1+chi))/(1+chi);
u = (c^(1-sigma))/(1-sigma) - (l^(1+chi))/(1+chi) + (2*g)^theta; % Alternative specification: benefit of government spending
welf = u/(1-betta);
% Auxiliary variables
cy_ratio = c/y;
iy_ratio = i/y;
gy_ratio = g/y;
ky_ratio = k/y;
end;
steady;
stoch_simul(order=1,irf=100,nograph) y,c,i,l;