Commit 22247c80 authored by michel's avatar michel
Browse files

v4: correcting bug with deterministic exogenous variables in stochastic models


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1485 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 3eea736e
......@@ -169,20 +169,17 @@ else
oo_.exo_steady_state = [] ;
end
tempex = oo_.exo_simul;
it_ = M_.maximum_lag + 1;
z = repmat(dr.ys,1,klen);
z = z(iyr0) ;
if options_.order == 1
[junk,jacobia_] = feval([M_.fname '_dynamic'],z,tempex);
[junk,jacobia_] = feval([M_.fname '_dynamic'],z,[oo_.exo_simul ...
oo_.exo_det_simul]);
elseif options_.order == 2
[junk,jacobia_,hessian] = feval([M_.fname '_dynamic'],z,...
[oo_.exo_simul ...
oo_.exo_det_simul]);
end
oo_.exo_simul = tempex ;
tempex = [];
end
if options_.debug
......
......@@ -22,10 +22,10 @@ function forecast(var_list)
exo_det_length = size(oo_.exo_det_simul,1);
if options_.periods > exo_det_length
ex = zeros(options_.periods,M_.exo_nbr);
oo_.ex_det_simul = [ oo_.exo_det_simul;...
oo_.exo_det_simul = [ oo_.exo_det_simul;...
repmat(oo_.exo_det_steady_state',...
options_.periods- ...
ex_det_length,1)];
exo_det_length,1)];
%ex_det_length,1),1)];
elseif options_.periods < exo_det_length
ex = zeros(exo_det_length,M_.exo_nbr);
......
......@@ -9,7 +9,7 @@ function set_shocks(flag,k,ivar,values)
if k(end) > n1 & flag <= 1
oo_.exo_simul = [oo_.exo_simul; repmat(oo_.exo_steady_state',k(end)-n1,1)];
elseif k(end) > n2 & flag > 1
oo_.exo_det_simul = [oo_.exo_det_simul; repmat(oo_.exo_steady_state',k(end)-n2,1)];
oo_.exo_det_simul = [oo_.exo_det_simul; repmat(oo_.exo_det_steady_state',k(end)-n2,1)];
end
switch flag
......
Supports Markdown
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