Fix constant part of forecasts with loglinear option

Erroneously, the unlogged steady state was added
time-shift
Johannes Pfeifer 2015-03-01 14:25:28 +01:00 committed by Johannes Pfeifer
parent 452dfa6a7b
commit b8377b8de5
1 changed files with 5 additions and 1 deletions

View File

@ -75,7 +75,7 @@ switch task
y0 = zeros(M.endo_nbr,maximum_lag);
for i = 1:M.endo_nbr
v_name = deblank(M.endo_names(i,:));
y0(i,:) = y_smoothed.(v_name)(end-maximum_lag+1:end)+oo.dr.ys(i);
y0(i,:) = y_smoothed.(v_name)(end-maximum_lag+1:end)+oo.dr.ys(i); %does not need to be logged in loglinear case, because simult_ will subtract unlooged steady state
end
gend = options.nobs;
if isfield(oo.Smoother,'TrendCoeffs')
@ -124,6 +124,10 @@ if ~isscalar(trend)
yf(i_var_obs,:) = yf(i_var_obs,:) + trend;
end
if options.loglinear == 1
yf=yf-oo.dr.ys(i_var)*ones(1,horizon+1)+log(oo.dr.ys(i_var))*ones(1,horizon+1); %take care of logged steady state in this case; above the unlogged one was added
end
for i=1:n_var
vname = deblank(var_list(i,:));
forecast.Mean.(vname) = yf(i,maximum_lag+(1:horizon))';