Commit fd880a93 authored by Houtan Bastani's avatar Houtan Bastani

gui: other simplifications/aesthetic changes

parent 922536e4
Pipeline #778 passed with stages
in 877 minutes and 3 seconds
......@@ -42,7 +42,7 @@ if nargout > 1
end
%% Read JSON
jm = loadjson(json, 'SimplifyCell', 0);
jm = loadjson(json, 'SimplifyCell', 1);
%% INITVAL instructions
% initialize exogenous shocks to zero and compute initial steady state
......@@ -107,7 +107,8 @@ if isfield(jm, 'transitory_shocks') && ~isempty(jm.transitory_shocks)
M_.exo_det_length = 0;
end
if jm.nonanticipatedshockexist == 1 || jm.delayexist == 1
if isfield(jm, 'unanticipated_shocks') && ~isempty(jm.unanticipated_shocks) ...
|| isfield(jm, 'expected_date') && ~isempty(jm.expected_date)
nonanticip = jm.nonanticipmatrix;
rowindex = 1;
firstsimul = 0;
......@@ -117,10 +118,24 @@ if jm.nonanticipatedshockexist == 1 || jm.delayexist == 1
% there are nonanticipated shocks to add at first period
if nonanticip{rowindex}{4} == 0
% this is a current nonanticipated shock
M_.det_shocks = [ M_.det_shocks;struct('exo_det',0,'exo_id',(nonanticip{rowindex}{2}+1),'multiplicative',0,'periods',1:1,'value',nonanticip{rowindex}{7}) ];
M_.det_shocks = [ ...
M_.det_shocks; ...
struct( ...
'exo_det', 0, ...
'exo_id', nonanticip{rowindex}{2}+1, ...
'multiplicative', 0, ...
'periods', 1:1, ...
'value',nonanticip{rowindex}{7})];
else
% this is a delayed nonanticipated shock
M_.det_shocks = [ M_.det_shocks;struct('exo_det',0,'exo_id',(nonanticip{rowindex}{2}+1),'multiplicative',0,'periods',(nonanticip{rowindex}{5}):(nonanticip{rowindex}{6}),'value',nonanticip{rowindex}{7}) ];
M_.det_shocks = [ ...
M_.det_shocks; ...
struct( ...
'exo_det', 0, ...
'exo_id', nonanticip{rowindex}{2}+1, ...
'multiplicative', 0, ...
'periods', nonanticip{rowindex}{5}:nonanticip{rowindex}{6}, ...
'value', nonanticip{rowindex}{7})];
end
if nonanticip{rowindex+1}{1} ~= currentperiod
% when we have tracked all first period shocks we can simulate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment