diff --git a/Aguiar_Gopinath_2007/Aguiar_Gopinath_2007.mod b/Aguiar_Gopinath_2007/Aguiar_Gopinath_2007.mod index fd6e7f5..75bd686 100644 --- a/Aguiar_Gopinath_2007/Aguiar_Gopinath_2007.mod +++ b/Aguiar_Gopinath_2007/Aguiar_Gopinath_2007.mod @@ -27,7 +27,7 @@ */ /* - * Copyright (C) 2013-15 Johannes Pfeifer + * Copyright (C) 2013-2024 Johannes Pfeifer * * This is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -169,6 +169,9 @@ log_Gamma_0=0; //Initialize Level of Technology at t=0; log_Gamma(1,1)=g_eps_g(1,1)+log_Gamma_0; //Level of Tech. after shock in period 1 // reaccumulate the non-stationary level series; note that AG2007 detrend with X_t-1, thus the technology level in the loop is shifted by 1 period +log_y_nonstationary = zeros(options_.irf,1); +log_c_nonstationary = zeros(options_.irf,1); +log_i_nonstationary = zeros(options_.irf,1); for ii=2:options_.irf log_Gamma(ii,1)=g_eps_g(ii,1)+log_Gamma(ii-1,1); log_y_nonstationary(ii,1)=log_y_eps_g(ii,1)+log_Gamma(ii-1,1); @@ -215,7 +218,9 @@ log_Gamma_0=0; //Initialize Level of Technology at t=0; log_Gamma(1,1)=g(1,1)+log_Gamma_0; //Level of Tech. after shock in period 1 // reaccumulate the non-stationary level series - +log_y_nonstationary = zeros(options_.periods,1); +log_c_nonstationary = zeros(options_.periods,1); +log_i_nonstationary = zeros(options_.periods,1); for ii=2:options_.periods log_Gamma(ii,1)=g(ii,1)+log_Gamma(ii-1,1); log_y_nonstationary(ii,1)=log_y(ii,1)+log_Gamma(ii-1,1); diff --git a/Smets_Wouters_2007/Smets_Wouters_2007_45.mod b/Smets_Wouters_2007/Smets_Wouters_2007_45.mod index d8f3b6a..09956e1 100644 --- a/Smets_Wouters_2007/Smets_Wouters_2007_45.mod +++ b/Smets_Wouters_2007/Smets_Wouters_2007_45.mod @@ -401,8 +401,14 @@ end; varobs dy dc dinve labobs pinfobs dw robs; -prior_function(function='PC_slope'); -PC_slope_vec=cell2mat(oo_.prior_function_results(:,1)); +all_positive = false; +while ~all_positive + prior_function(function='PC_slope'); + PC_slope_vec=cell2mat(oo_.prior_function_results(:,1)); + if all(PC_slope_vec>0) + all_positive = true; + end +end [f,xi] = ksdensity(PC_slope_vec,'Support','positive'); figure('Name','Prior Slope of the Phillips Curve') plot(xi,f); diff --git a/run_all_files.m b/run_all_files.m index 7ce3467..26f6e88 100644 --- a/run_all_files.m +++ b/run_all_files.m @@ -1,5 +1,4 @@ clearvars all; clearvars -global; -bad_folders = []; %% Aguiar_Gopinath_2007 try @@ -232,7 +231,7 @@ cd('../Jermann_Quadrini_2012_NK'); dynare Jermann_Quadrini_2012_NK catch ME - bad_folders = [bad_folders; "Jermann_Quadrini_2012"]; + fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid); end %% McCandless_2008 @@ -270,7 +269,7 @@ dynare RBC_baseline dynare RBC_baseline_first_diff_bayesian catch ME - bad_folders = [bad_folders; "RBC_baseline"]; + fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid); end %% RBC_baseline_welfare