From 7a87a7b20030374c67d1976947a26165f40224f4 Mon Sep 17 00:00:00 2001 From: michel Date: Mon, 1 Oct 2007 09:39:32 +0000 Subject: [PATCH] v4: corrected bug in handling of trend_coeff git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1402 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/DsgeLikelihood.m | 2 +- matlab/DsgeLikelihood_hh.m | 2 +- matlab/DsgeSmoother.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matlab/DsgeLikelihood.m b/matlab/DsgeLikelihood.m index a34d264ae..8ff1f8751 100644 --- a/matlab/DsgeLikelihood.m +++ b/matlab/DsgeLikelihood.m @@ -116,7 +116,7 @@ function [fval,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data if bayestopt_.with_trend == 1 trend_coeff = zeros(nobs,1); t = options_.trend_coeffs; - for i=1:nobs + for i=1:length(t) if ~isempty(t{i}) trend_coeff(i) = evalin('base',t{i}); end diff --git a/matlab/DsgeLikelihood_hh.m b/matlab/DsgeLikelihood_hh.m index bc7f8c795..a5ec7ebc4 100644 --- a/matlab/DsgeLikelihood_hh.m +++ b/matlab/DsgeLikelihood_hh.m @@ -122,7 +122,7 @@ function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend if bayestopt_.with_trend == 1 trend_coeff = zeros(nobs,1); t = options_.trend_coeffs; - for i=1:nobs + for i=1:length(t) if ~isempty(t{i}) trend_coeff(i) = evalin('base',t{i}); end diff --git a/matlab/DsgeSmoother.m b/matlab/DsgeSmoother.m index c765fac90..7f7d03a88 100644 --- a/matlab/DsgeSmoother.m +++ b/matlab/DsgeSmoother.m @@ -52,7 +52,7 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R] = Dsge if bayestopt_.with_trend == 1 trend_coeff = zeros(nobs,1); t = options_.trend_coeffs; - for i=1:nobs + for i=1:length(t) if ~isempty(t{i}) trend_coeff(i) = evalin('base',t{i}); end