| 1 |
function [info,nG,nKAP,nD,nGAM,nPHI] = cet_steady_helper(justCheck,Kw,J,V,U,dolagZBAR,mu,thetaG,thetaKAP,thetaD,thetaGAM,thetaPHI) |
| 2 |
% [info,nG,nKAP,nD,nGAM,nPHI] = cet_steady_helper(justCheck,Kw,J,V,U,dolagZBAR,mu,thetaG,thetaKAP,thetaD,thetaGAM,thetaPHI) |
| 3 |
% ------------------------------------------------------------------------- |
| 4 |
% Based on cet_steadystate.m of the replication codes for |
| 5 |
% Christiano, Eichenbaum, Trabandt (2016, Econometrica); |
| 6 |
% slightly modified such that most of the code is in a steady_state_model block |
| 7 |
% and only the two if statements are computed in this helper function. |
| 8 |
% ------------------------------------------------------------------------- |
| 9 |
|
| 10 |
% Copyright © 2023 Dynare Team |
| 11 |
% |
| 12 |
% This file is part of Dynare. |
| 13 |
% |
| 14 |
% Dynare is free software: you can redistribute it and/or modify |
| 15 |
% it under the terms of the GNU General Public License as published by |
| 16 |
% the Free Software Foundation, either version 3 of the License, or |
| 17 |
% (at your option) any later version. |
| 18 |
% |
| 19 |
% Dynare is distributed in the hope that it will be useful, |
| 20 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
% GNU General Public License for more details. |
| 23 |
% |
| 24 |
% You should have received a copy of the GNU General Public License |
| 25 |
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. |
| 26 |
|
| 27 |
info = 0; |
| 28 |
if justCheck |
| 29 |
if (Kw<0) |
| 30 |
disp('could not compute steadystate: Kw<0'); |
| 31 |
elseif (J<0) |
| 32 |
disp('could not compute steadystate: J<0'); |
| 33 |
elseif (V-U<0) |
| 34 |
disp('could not compute steadystate: V-U<0') |
| 35 |
info=1; |
| 36 |
end |
| 37 |
return |
| 38 |
else |
| 39 |
if dolagZBAR==1 |
| 40 |
nG=mu^(-1/thetaG); |
| 41 |
nKAP=mu^(-1/thetaKAP); |
| 42 |
nD=mu^(-1/thetaD); |
| 43 |
nGAM=mu^(-1/thetaGAM); |
| 44 |
nPHI=mu^(-1/thetaPHI); |
| 45 |
else |
| 46 |
nG=(1/mu)^((1-thetaG)/thetaG); |
| 47 |
nKAP=(1/mu)^((1-thetaKAP)/thetaKAP); |
| 48 |
nD=(1/mu)^((1-thetaD)/thetaD); |
| 49 |
nGAM=(1/mu)^((1-thetaGAM)/thetaGAM); |
| 50 |
nPHI=(1/mu)^((1-thetaPHI)/thetaPHI); |
| 51 |
end |
| 52 |
end |