v4: bug in handling of options_.trend_coeffs

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1399 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2007-09-27 15:35:40 +00:00
parent 4a0aeb12de
commit f3375020fc
3 changed files with 12 additions and 4 deletions

View File

@ -115,8 +115,11 @@ function [fval,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data
end
if bayestopt_.with_trend == 1
trend_coeff = zeros(nobs,1);
t = options_.trend_coeffs;
for i=1:nobs
trend_coeff(i) = evalin('base',bayestopt_.trend_coeff{i});
if ~isempty(t{i})
trend_coeff(i) = evalin('base',t{i});
end
end
trend = repmat(constant,1,gend)+trend_coeff*[1:gend];
else

View File

@ -121,8 +121,11 @@ function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend
end
if bayestopt_.with_trend == 1
trend_coeff = zeros(nobs,1);
t = options_.trend_coeffs;
for i=1:nobs
trend_coeff(i) = evalin('base',bayestopt_.trend_coeff{i});
if ~isempty(t{i})
trend_coeff(i) = evalin('base',t{i});
end
end
trend = repmat(constant,1,gend)+trend_coeff*[1:gend];
else

View File

@ -51,9 +51,11 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R] = Dsge
trend_coeff = zeros(nobs,1);
if bayestopt_.with_trend == 1
trend_coeff = zeros(nobs,1);
nx1 = estim_params_.nvx+estim_params_.nvn+estim_params_.ncx+estim_params_.ncn;
t = options_.trend_coeffs;
for i=1:nobs
trend_coeff(i) = evalin('base',bayestopt_.trend_coeff{i});
if ~isempty(t{i})
trend_coeff(i) = evalin('base',t{i});
end
end
trend = constant*ones(1,gend)+trend_coeff*(1:gend);
else