4.1: corrected bug in initialization of horizon for case: 'simul'
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2669 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
33b9537149
commit
2eed8a5fb2
|
@ -41,7 +41,6 @@ function info = forecast(var_list,task)
|
||||||
old_options = options_;
|
old_options = options_;
|
||||||
|
|
||||||
maximum_lag = M_.maximum_lag;
|
maximum_lag = M_.maximum_lag;
|
||||||
horizon = options_.forecast;
|
|
||||||
|
|
||||||
|
|
||||||
endo_names = M_.endo_names;
|
endo_names = M_.endo_names;
|
||||||
|
@ -62,13 +61,18 @@ function info = forecast(var_list,task)
|
||||||
|
|
||||||
trend = 0;
|
trend = 0;
|
||||||
switch task
|
switch task
|
||||||
case 'simul'
|
case 'simul'
|
||||||
|
horizon = options_.periods;
|
||||||
|
if horizon == 0
|
||||||
|
horizon = 5;
|
||||||
|
end
|
||||||
if size(oo_.endo_simul,2) < maximum_lag
|
if size(oo_.endo_simul,2) < maximum_lag
|
||||||
y0 = repmat(oo_.steady_state,1,maximum_lag);
|
y0 = repmat(oo_.steady_state,1,maximum_lag);
|
||||||
else
|
else
|
||||||
y0 = oo_.endo_simul(:,1:maximum_lag);
|
y0 = oo_.endo_simul(:,1:maximum_lag);
|
||||||
end
|
end
|
||||||
case 'smoother'
|
case 'smoother'
|
||||||
|
horizon = options_.forecast;
|
||||||
y_smoothed = oo_.SmoothedVariables;
|
y_smoothed = oo_.SmoothedVariables;
|
||||||
y0 = zeros(M_.endo_nbr,maximum_lag);
|
y0 = zeros(M_.endo_nbr,maximum_lag);
|
||||||
for i = 1:M_.endo_nbr
|
for i = 1:M_.endo_nbr
|
||||||
|
|
Loading…
Reference in New Issue