From 28536314c07e7d6d53d43d8552568f02f3a3a979 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 14 Mar 2022 14:50:49 +0100 Subject: [PATCH] posterior moments: fix bugs that cause crashes - Delete non-existing output argument - prevent info from being overwritten --- matlab/compute_decision_rules.m | 2 +- matlab/selec_posterior_draws.m | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/matlab/compute_decision_rules.m b/matlab/compute_decision_rules.m index 39674027b..9afd383b5 100644 --- a/matlab/compute_decision_rules.m +++ b/matlab/compute_decision_rules.m @@ -1,5 +1,5 @@ function [dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_) -% function [dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_) +% function [dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_) % INPUTS % - M_ [structure] Matlab's structure describing the model (M_). % - options_ [structure] Matlab's structure describing the current options (options_). diff --git a/matlab/selec_posterior_draws.m b/matlab/selec_posterior_draws.m index 8ab7560d4..a590a339b 100644 --- a/matlab/selec_posterior_draws.m +++ b/matlab/selec_posterior_draws.m @@ -20,7 +20,7 @@ function SampleAddress = selec_posterior_draws(SampleSize,drsize) % None. % -% Copyright (C) 2006-2017 Dynare Team +% Copyright (C) 2006-2022 Dynare Team % % This file is part of Dynare. % @@ -113,9 +113,9 @@ if info load([BaseName '_mh' num2str(mhfile) '_blck' num2str(mhblck) '.mat'],'x2') end pdraws(i,1) = {x2(SampleAddress(i,4),:)}; - if info-1 + if info==2 set_parameters(pdraws{i,1}); - [dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_); + [dr,~,M_,oo_] =compute_decision_rules(M_,options_,oo_); pdraws(i,2) = { dr }; end old_mhfile = mhfile; @@ -140,9 +140,9 @@ if info load([BaseName '_mh' num2str(mhfile) '_blck' num2str(mhblck) '.mat'],'x2') end pdraws(linee,1) = {x2(SampleAddress(i,4),:)}; - if info-1 + if info==2 set_parameters(pdraws{linee,1}); - [dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_); + [dr,~,M_,oo_] = compute_decision_rules(M_,options_,oo_); pdraws(linee,2) = { dr }; end old_mhfile = mhfile;