Skip to content
Snippets Groups Projects
Commit 380fd370 authored by MichelJuillard's avatar MichelJuillard
Browse files

fixing bug in ramsey policy when using initval instead of steady_state_model

parent 62b1ed79
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ else ...@@ -61,7 +61,7 @@ else
[xx,info1] = dynare_solve(nl_func,xx,0); [xx,info1] = dynare_solve(nl_func,xx,0);
steady_state = nl_func(xx); steady_state = nl_func(xx);
end end
steady_state = nl_func(xx); [junk,junk,steady_state] = nl_func(xx);
...@@ -86,14 +86,14 @@ max_lag = M.maximum_lag; ...@@ -86,14 +86,14 @@ max_lag = M.maximum_lag;
i_endo = [1:endo_nbr]'; i_endo = [1:endo_nbr]';
% indices of endogenous variable except instruments % indices of endogenous variable except instruments
% i_inst = M.instruments; % i_inst = M.instruments;
% lead_lag incidence matrix for endogenous variables % lead_lag incidence matrix
i_lag = M.lead_lag_incidence; i_lag = M.lead_lag_incidence;
if options_.steadystate_flag if options_.steadystate_flag
k_inst = []; k_inst = [];
instruments = options_.instruments; instruments = options_.instruments;
for i = 1:size(instruments,1) for i = 1:size(instruments,1)
k_inst = [k_inst; strmatch(options_.instruments(i,:), ... k_inst = [k_inst; strmatch(instruments(i,:), ...
M.endo_names,'exact')]; M.endo_names,'exact')];
end end
oo.steady_state(k_inst) = x; oo.steady_state(k_inst) = x;
...@@ -134,7 +134,7 @@ xx = [x; zeros(M.endo_nbr - M.orig_eq_nbr,1)]; ...@@ -134,7 +134,7 @@ xx = [x; zeros(M.endo_nbr - M.orig_eq_nbr,1)];
% the auxiliary variables before the Lagrange multipliers are treated % the auxiliary variables before the Lagrange multipliers are treated
% as ordinary endogenous variables % as ordinary endogenous variables
n_var = M.orig_endo_nbr + min(find([M.aux_vars.type] == 6)) - 1; n_var = M.orig_endo_nbr + min(find([M.aux_vars.type] == 6)) - 1;
aux_eq = [1:n_var orig_endo_nbr+orig_eq_nbr+1:size(fJ,1)]; aux_eq = [1:n_var, orig_endo_nbr+orig_eq_nbr+1:size(fJ,1)];
A = fJ(aux_eq,n_var+1:end); A = fJ(aux_eq,n_var+1:end);
y = res(aux_eq); y = res(aux_eq);
mult = -A\y; mult = -A\y;
...@@ -149,7 +149,7 @@ end ...@@ -149,7 +149,7 @@ end
if options_.steadystate_flag if options_.steadystate_flag
resids = r1; resids = r1;
else else
resids = [res; r1]; resids = [resids1; r1];
end end
rJ = []; rJ = [];
steady_state = [x(1:n_var); mult]; steady_state = [x(1:n_var); mult];
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment