From e5854cb2014c0906bd1d797f251547b77fc415aa Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Sat, 7 Dec 2013 10:52:27 +0100 Subject: [PATCH] Fixes to mode_compute=5. (1) force univariate steps at every iteration: improve robustness at the expenses of a bit less efficiency; (2) fix gradient computation for special cases when the value of the parameters get stacked at the prior boundary. --- matlab/mr_hessian.m | 1 + matlab/newrat.m | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/matlab/mr_hessian.m b/matlab/mr_hessian.m index 9fe04ddad..a428a3c92 100644 --- a/matlab/mr_hessian.m +++ b/matlab/mr_hessian.m @@ -101,6 +101,7 @@ while igtol && check==0 && jit1 && (fval0(icount-1)-fval0(icount))>1) || ((fval0(icount)-fval)<1.e-2*(gg'*(H*gg))/2 && igibbs), +% if icount==1 || (icount>1 && (fval0(icount-1)-fval0(icount))>1) || ((fval0(icount)-fval)<1.e-2*(gg'*(H*gg))/2 && igibbs), if length(find(ig))gtol && check==0 && jit