| 1 |
% Stochastic growth model of Brock and Mirman (1972) with technology shock |
| 2 |
% created by Willi Mutschler (@wmutschl, [email protected]) |
| 3 |
% ========================================================================= |
| 4 |
% Copyright © 2019-2020 Dynare Team |
| 5 |
% |
| 6 |
% This file is part of Dynare. |
| 7 |
% |
| 8 |
% Dynare is free software: you can redistribute it and/or modify |
| 9 |
% it under the terms of the GNU General Public License as published by |
| 10 |
% the Free Software Foundation, either version 3 of the License, or |
| 11 |
% (at your option) any later version. |
| 12 |
% |
| 13 |
% Dynare is distributed in the hope that it will be useful, |
| 14 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
% GNU General Public License for more details. |
| 17 |
% |
| 18 |
% You should have received a copy of the GNU General Public License |
| 19 |
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. |
| 20 |
% ========================================================================= |
| 21 |
|
| 22 |
var |
| 23 |
C ${C}$ (long_name='consumption') |
| 24 |
K ${K}$ (long_name='capital') |
| 25 |
A ${Z}$ (long_name='total factor productivity') |
| 26 |
; |
| 27 |
varobs C; |
| 28 |
|
| 29 |
varexo |
| 30 |
eps_A ${\varepsilon_A}$ (long_name='TFP shock') |
| 31 |
; |
| 32 |
|
| 33 |
parameters |
| 34 |
alph ${\alpha}$ (long_name='capital share') |
| 35 |
betta ${\beta}$ (long_name='discount factor') |
| 36 |
rhoA ${\rho_A}$ (long_name='persistence TFP') |
| 37 |
sigA ${\sigma_A}$ (long_name='standard deviation TFP shock') |
| 38 |
; |
| 39 |
|
| 40 |
alph = 0.35; |
| 41 |
betta = 0.99; |
| 42 |
rhoA = 0.9; |
| 43 |
sigA = 0.6; |
| 44 |
|
| 45 |
model; |
| 46 |
[name='Euler equation'] |
| 47 |
C^(-1)=alph*betta*C(+1)^(-1)*A(+1)*K^(alph-1); |
| 48 |
[name='capital law of motion'] |
| 49 |
K=A*K(-1)^alph-C; |
| 50 |
[name='exogenous TFP process'] |
| 51 |
log(A)=rhoA*log(A(-1))+sigA*eps_A; |
| 52 |
end; |
| 53 |
|
| 54 |
shocks; |
| 55 |
var eps_A = 1; |
| 56 |
end; |
| 57 |
|
| 58 |
steady_state_model; |
| 59 |
A = 1; % technology level |
| 60 |
K = (alph*betta*A)^(1/(1-alph)); % capital level |
| 61 |
C = A*K^alph-K; % consumption level |
| 62 |
end; |
| 63 |
|
| 64 |
steady; % compute steady state given the starting values |
| 65 |
resid; % check the starting values for the steady state |
| 66 |
check; % check Blanchard & Khan rank condition |
| 67 |
|
| 68 |
@#define CORRFLAG = 1 |
| 69 |
|
| 70 |
@#ifdef kronflag |
| 71 |
identification(ar=3, useautocorr=@{CORRFLAG}, nodisplay, nograph, parameter_set=calibration, analytic_derivation_mode=@{kronflag},tol_rank=1e-8); |
| 72 |
@#else |
| 73 |
identification(ar=3, useautocorr=@{CORRFLAG}, nodisplay, nograph, parameter_set=calibration, analytic_derivation_mode=0, tol_rank=1e-8); |
| 74 |
@#endif |
| 75 |
|
| 76 |
% Unit test for correct identification results |
| 77 |
load('BrockMirman/identification/BrockMirman_Current_params_identif.mat','ide_moments_point', 'ide_spectrum_point', 'ide_minimal_point', 'ide_reducedform_point') |
| 78 |
pause(1); |
| 79 |
chk.ind0 = [1 1 1 1 1]; |
| 80 |
chk.indno = [1 0 0 0 1]; |
| 81 |
chk.jweak = [1 0 0 0 1]; |
| 82 |
chk.jweak_pair = [0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; |
| 83 |
for strVars = {'ind0' 'indno' 'jweak' 'jweak_pair'} |
| 84 |
if ~isequal(ide_moments_point.(strVars{:}) , chk.(strVars{:})) |
| 85 |
disp('dMoments:') |
| 86 |
disp(ide_moments_point.dMOMENTS); |
| 87 |
disp(strVars{:}) |
| 88 |
disp(ide_moments_point.(strVars{:})); |
| 89 |
error('identification based on moments is wrong for %s',strVars{:}) |
| 90 |
end |
| 91 |
if ~isequal(ide_spectrum_point.(strVars{:}) , chk.(strVars{:})) |
| 92 |
disp('dSPECTRUM'); |
| 93 |
disp(ide_spectrum_point.dSPECTRUM); |
| 94 |
disp(strVars{:}) |
| 95 |
disp(ide_spectrum_point.(strVars{:})); |
| 96 |
error('identification based on spectrum is wrong for %s',strVars{:}) |
| 97 |
end |
| 98 |
if ~isequal(ide_minimal_point.(strVars{:}) , chk.(strVars{:})) |
| 99 |
disp('dMINIMAL') |
| 100 |
disp(ide_minimal_point.dMINIMAL); |
| 101 |
disp(strVars{:}) |
| 102 |
disp(ide_minimal_point.(strVars{:})); |
| 103 |
error('identification based on minimal system is wrong for %s',strVars{:}) |
| 104 |
end |
| 105 |
end |
| 106 |
|