Correction of a bug in the estimation of smoothed variables (occasionaly systematic error in the level).

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1391 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
adjemian 2007-09-21 16:22:16 +00:00
parent 6ea51663a6
commit a53e4db7ab
2 changed files with 18 additions and 11 deletions

View File

@ -39,10 +39,14 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R] = Dsge
%------------------------------------------------------------------------------
[T,R,SteadyState] = dynare_resolve;
bayestopt_.mf = bayestopt_.mf2;
if options_.loglinear == 1
constant = log(SteadyState(bayestopt_.mfys));
if options_.noconstant
constant = zeros(nobs,1);
else
constant = SteadyState(bayestopt_.mfys);
if options_.loglinear == 1
constant = log(SteadyState(bayestopt_.mfys));
else
constant = SteadyState(bayestopt_.mfys);
end
end
trend_coeff = zeros(nobs,1);
if bayestopt_.with_trend == 1

View File

@ -1021,15 +1021,18 @@ if ~((any(bayestopt_.pshape > 0) & options_.mh_replic) | (any(bayestopt_.pshape
%%
%% Smooth observational errors...
%%
yf = zeros(gend,n_varobs);
if options_.prefilter == 1
yf = atT(bayestopt_.mf,:)+repmat(transpose(bayestopt_.mean_varobs),1,gend);
elseif options_.loglinear == 1
yf = atT(bayestopt_.mf,:)+repmat(log(ys(bayestopt_.mfys)),1,gend)+...
trend_coeff*[1:gend];
if options_.noconstant
yf = zeros(n_varobs,gend);
else
yf = atT(bayestopt_.mf,:)+repmat(ys(bayestopt_.mfys),1,gend)+...
trend_coeff*[1:gend];
if options_.prefilter == 1
yf = atT(bayestopt_.mf,:)+repmat(transpose(bayestopt_.mean_varobs),1,gend);
elseif options_.loglinear == 1
yf = atT(bayestopt_.mf,:)+repmat(log(ys(bayestopt_.mfys)),1,gend)+...
trend_coeff*[1:gend];
else
yf = atT(bayestopt_.mf,:)+repmat(ys(bayestopt_.mfys),1,gend)+...
trend_coeff*[1:gend];
end
end
if nvn
number_of_plots_to_draw = 0;