From fda047e19cf276aea1693528791924ce3efeecf3 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Tue, 21 Aug 2012 17:07:46 +0200 Subject: [PATCH] updated penalty has to be properly passed to the objective function. This relates should fix behaviour after commit 6b3bd9dd0bc2392e52c873891cef9b2451a5443c. --- matlab/csminwel1.m | 4 ++-- matlab/newrat.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matlab/csminwel1.m b/matlab/csminwel1.m index 4981da01d..e53a852a9 100644 --- a/matlab/csminwel1.m +++ b/matlab/csminwel1.m @@ -40,7 +40,7 @@ function [fh,xh,gh,H,itct,fcount,retcodeh] = csminwel1(fcn,x0,H0,grad,crit,nit,m % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -global bayestopt_ +% global bayestopt_ fh = []; xh = []; @@ -91,7 +91,7 @@ f=f0; H=H0; cliff=0; while ~done - bayestopt_.penalty = f; + varargin{5}.penalty = f; g1=[]; g2=[]; g3=[]; %addition fj. 7/6/94 for control disp('-----------------') diff --git a/matlab/newrat.m b/matlab/newrat.m index 19f1d7e0e..8edaff6af 100644 --- a/matlab/newrat.m +++ b/matlab/newrat.m @@ -106,7 +106,7 @@ while norm(gg)>gtol && check==0 && jit