Fix bugs in det_cond_forecast.m
parent
77f5d572de
commit
6d7218f9dc
|
@ -34,7 +34,9 @@ pp = 2;
|
||||||
initial_conditions = oo_.steady_state;
|
initial_conditions = oo_.steady_state;
|
||||||
verbosity = options_.verbosity;
|
verbosity = options_.verbosity;
|
||||||
options_.verbosity = 0;
|
options_.verbosity = 0;
|
||||||
|
if options_.periods == 0
|
||||||
|
options_.periods = 25;
|
||||||
|
end;
|
||||||
%We have to get an initial guess for the conditional forecast
|
%We have to get an initial guess for the conditional forecast
|
||||||
% and terminal conditions for the non-stationary variables, we
|
% and terminal conditions for the non-stationary variables, we
|
||||||
% use the first order approximation of the rational expectation solution.
|
% use the first order approximation of the rational expectation solution.
|
||||||
|
@ -134,11 +136,19 @@ else
|
||||||
oo_.endo_simul(M_.aux_vars(i).endo_index, 1:sym_dset.nobs) = repmat(oo_.steady_state(M_.aux_vars(i).endo_index), 1, range.ndat + 1);
|
oo_.endo_simul(M_.aux_vars(i).endo_index, 1:sym_dset.nobs) = repmat(oo_.steady_state(M_.aux_vars(i).endo_index), 1, range.ndat + 1);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
%Compute the initial path using the first order solution around the
|
%Compute the initial path using the the steady-state
|
||||||
% steady-state
|
% steady-state
|
||||||
for jj = 2 : (options_.periods + 2)
|
for jj = 2 : (options_.periods + 2)
|
||||||
oo_.endo_simul(:, jj) = oo_.steady_state;
|
oo_.endo_simul(:, jj) = oo_.steady_state;
|
||||||
end
|
end
|
||||||
|
missings = isnan(oo_.endo_simul(:,1));
|
||||||
|
if any(missings)
|
||||||
|
for jj = 1:M_.endo_nbr
|
||||||
|
if missings(jj)
|
||||||
|
oo_.endo_simul(jj,1) = oo_.steady_state(jj,1);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if options_.bytecode
|
if options_.bytecode
|
||||||
save_options_dynatol_f = options_.dynatol.f;
|
save_options_dynatol_f = options_.dynatol.f;
|
||||||
|
|
Loading…
Reference in New Issue