diff --git a/matlab/DsgeLikelihood.m b/matlab/DsgeLikelihood.m index 1f273db77..c3dbd92de 100644 --- a/matlab/DsgeLikelihood.m +++ b/matlab/DsgeLikelihood.m @@ -6,7 +6,7 @@ function [fval,cost_flag,ys,trend_coeff] = DsgeLikelihood(xparam1,gend,data) global dr1_test_ fval = []; - ys = []; + ys = []; trend_coeff = []; cost_flag = 1; nobs = size(options_.varobs,1); diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m index 2a603f34d..5d93fa608 100644 --- a/matlab/dynare_estimation.m +++ b/matlab/dynare_estimation.m @@ -298,7 +298,8 @@ if any(bayestopt_.pshape > 0) & options_.posterior_mode_estimation disp('standard deviation of shocks') disp(tit1) for i=1:nvx - name = deblank(M_.exo_names(estim_params_.var_exo(i,1),:)); + k = estim_params_.var_exo(i,1); + name = deblank(M_.exo_names(k,:)); disp(sprintf('%12s %7.3f %8.4f %7.4f %7.4f %4s %6.4f', ... name,bayestopt_.pmean(ip),xparam1(ip), ... stdh(ip),tstath(ip),pnames(bayestopt_.pshape(ip)+1,:), ... @@ -361,7 +362,7 @@ if any(bayestopt_.pshape > 0) & options_.posterior_mode_estimation ip = ip+1; end end - %% Laplace approximation to the marginal log density: + %% Laplace approximation to the marginal log density: md_Laplace = .5*size(xparam1,1)*log(2*pi) + .5*log(det(invhess)) ... - DsgeLikelihood(xparam1,gend,data); oo_.MarginalDensity.LaplaceApproximation = md_Laplace; @@ -394,7 +395,8 @@ elseif ~any(bayestopt_.pshape > 0) & options_.posterior_mode_estimation disp('standard deviation of shocks') disp(tit1) for i=1:nvx - name = deblank(M_.exo_names(estim_params_.var_exo(i,1),:)); + k = estim_params_.var_exo(i,1); + name = deblank(M_.exo_names(k,:)); disp(sprintf('%12s %8.4f %7.4f %7.4f',name,xparam1(ip),stdh(ip),tstath(ip))); M_.Sigma_e(k,k) = xparam1(ip)*xparam1(ip); eval(['oo_.mle_mode.shocks_std.' name ' = xparam1(ip);']); diff --git a/matlab/get_the_name.m b/matlab/get_the_name.m index 24c346ebd..5e73fd5d5 100644 --- a/matlab/get_the_name.m +++ b/matlab/get_the_name.m @@ -10,14 +10,14 @@ nvn = estim_params_.nvn; ncx = estim_params_.ncx; ncx = estim_params_.ncn; -if k <= estim_params_.nvx +if k <= nvx vname = deblank(M_.exo_names(estim_params_.var_exo(k,1),:)); nam = ['SE_',vname]; if TeX tname = deblank(M_.exo_names_tex(estim_params_.var_exo(k,1),:)); texnam = ['$ SE_{' tname '} $']; end -elseif k <= (estim_params_.nvx+estim_params_.nvn) +elseif k <= (nvx+nvn) vname = deblank(options_.varobs(estim_params_.var_endo(k-estim_params_.nvx,1),:)); nam=['SE_EOBS_',vname]; if TeX