| 1 |
% DSGE model based on replication files of |
| 2 |
% Andreasen, Fernandez-Villaverde, Rubio-Ramirez (2018), The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications, Review of Economic Studies, 85, p. 1-49 |
| 3 |
% Adapted for Dynare by Willi Mutschler (@wmutschl, [email protected]), Jan 2021 |
| 4 |
% ========================================================================= |
| 5 |
% Copyright © 2021-2022 Dynare Team |
| 6 |
% |
| 7 |
% This file is part of Dynare. |
| 8 |
% |
| 9 |
% Dynare is free software: you can redistribute it and/or modify |
| 10 |
% it under the terms of the GNU General Public License as published by |
| 11 |
% the Free Software Foundation, either version 3 of the License, or |
| 12 |
% (at your option) any later version. |
| 13 |
% |
| 14 |
% Dynare is distributed in the hope that it will be useful, |
| 15 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
% GNU General Public License for more details. |
| 18 |
% |
| 19 |
% You should have received a copy of the GNU General Public License |
| 20 |
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. |
| 21 |
% ========================================================================= |
| 22 |
|
| 23 |
% This is a helper function to compute steady state values and endogenous parameters |
| 24 |
% Based on DSGE_model_yieldCurve_ss.m, getPHI3.m, ObjectGMM.m |
| 25 |
|
| 26 |
function [AA, EVFBAR, PHI3, negVf, info]= AFVRR_steady_helper(VFBAR,RBAR,IVBAR,CBAR,KBAR,LABAR,QBAR,YBAR, BETTA,B,PAI,H,PHIzero,PHI1,PHI2,THETA,MYYPS,MYZ,INHABIT,RRA,CONSxhr40) |
| 27 |
% We get nice values of EVF by setting AA app. equal to VF. |
| 28 |
% The value of the expected value function raised to the power 1-PHI3 |
| 29 |
% Also we check bounds on other variables |
| 30 |
% % Adding PHI3 to params. Note that PHI3 only affects the value function in |
| 31 |
% % steady state, hence the value we assign to PHI3 is irrelevant |
| 32 |
% PHI3 = -100; |
| 33 |
|
| 34 |
info=0; |
| 35 |
AA = NaN; |
| 36 |
EVFBAR = NaN; |
| 37 |
PHI3 = NaN; |
| 38 |
negVf = NaN; |
| 39 |
|
| 40 |
MYZSTAR = MYYPS^(THETA/(1-THETA))*MYZ; |
| 41 |
% The wage level |
| 42 |
WBAR = PHIzero*(1-H)^(-PHI1)/LABAR; |
| 43 |
RRAc = RRA; |
| 44 |
if INHABIT == 1 |
| 45 |
PHI3 = (RRAc - PHI2/((1-B*MYZSTAR^-1)/(1-BETTA*B)+PHI2/PHI1*WBAR*(1-H)/CBAR))/((1-PHI2)/((1-B*MYZSTAR^-1)/(1-BETTA*B)-(CBAR-B*CBAR*MYZSTAR^-1)^PHI2/((1-BETTA*B)*CBAR)+WBAR*(1-H)/CBAR*(1-PHI2)/(1-PHI1))); |
| 46 |
else |
| 47 |
PHI3 = (RRAc - PHI2/(1-B*MYZSTAR^-1+PHI2/PHI1*WBAR*(1-H)/CBAR))/((1-PHI2)/(1-B*MYZSTAR^-1-(CBAR-B*CBAR*MYZSTAR^-1)^PHI2/((1-BETTA*B)*CBAR)+WBAR*(1-H)/CBAR*(1-PHI2)/(1-PHI1))); |
| 48 |
end |
| 49 |
if abs(PHI3) > 30000 |
| 50 |
disp('abs of PHI3 exceeds 30000') |
| 51 |
info=1; |
| 52 |
return |
| 53 |
end |
| 54 |
|
| 55 |
if CONSxhr40 > 1 |
| 56 |
info=1; |
| 57 |
return |
| 58 |
end |
| 59 |
|
| 60 |
|
| 61 |
if VFBAR < 0 |
| 62 |
AA = -VFBAR; |
| 63 |
EVFBAR = (-VFBAR/AA)^(1-PHI3); |
| 64 |
negVf = 1; |
| 65 |
else |
| 66 |
AA = VFBAR; |
| 67 |
EVFBAR = (VFBAR/AA)^(1-PHI3); |
| 68 |
negVf = -1; |
| 69 |
disp('Positive Value Function'); |
| 70 |
end |
| 71 |
|
| 72 |
|
| 73 |
if RBAR < 1 || IVBAR < 0 || CBAR < 0 || KBAR < 0 || PAI < 1 || H < 0 || H > 1 || QBAR < 0 || YBAR < 0 |
| 74 |
info = 1; |
| 75 |
end |
| 76 |
|
| 77 |
end |
| 78 |
|
| 79 |
|
| 80 |
|