mshocks: better match to the semantics given in the manual

Ensure that the block is always interpreted multiplicatively relative to the
steady state, and not relative to the pre-existing shock value (if there was
already a shock declared for the same exogenous and period(s)).
kalman-mex
Sébastien Villemot 2023-10-18 10:19:46 -04:00
parent 357076feb4
commit daa6b5569d
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 3 additions and 3 deletions

View File

@ -89,13 +89,13 @@ if isfield(M_, 'det_shocks')
if ~M_.det_shocks(i).multiplicative
oo_.exo_simul(k,ivar) = v;
else
oo_.exo_simul(k,ivar) = oo_.exo_simul(k,ivar) .* v;
oo_.exo_simul(k,ivar) = oo_.exo_steady_state(ivar) * v;
end
else
if ~M_.det_shocks(i).multiplicative
oo_.exo_det_simul(k,ivar) = v;
else
oo_.exo_det_simul(k,ivar) = oo_.exo_det_simul(k,ivar) .* v;
oo_.exo_det_simul(k,ivar) = oo_.exo_det_steady_state(ivar) * v;
end
end
end

View File

@ -78,7 +78,7 @@ else
if ~M_.det_shocks(i).multiplicative
oo_.pfwee.shocks_info(exo_id, prds, 1) = v;
else
oo_.pfwee.shocks_info(exo_id, prds, 1) = oo_.pfwee.shocks_info(exo_id, prds, 1) .* v;
oo_.pfwee.shocks_info(exo_id, prds, 1) = oo_.exo_steady_state(exo_id) * v;
end
end
end