0

I'm trying to fit a function using leasqr in Octave. This performs properly most of the time. Sometimes, however, leasqr fails to converge. (I'm not sure why, because the solution it comes up with looks fine).

Untill I can figure out why it's not converging I would like to suppress the output. But whenever leasqr fails to converge I get the following warning:

CONVERGENCE NOT ACHIEVED!

I've tried implementing the answer to this question, but it's not working for me. My code looks like this:

PAGER('/dev/null');
page_screen_output(1);
page_output_immediately(1);
[fx.k1,fx.lambda1,fx.c1,...
fx.k2,fx.lambda2,fx.c2] = peaktrack_expfit(t,Mn,fnr,mode);

How do I suppress these convergence messages?

Community
  • 1
  • 1
jessems
  • 1,582
  • 2
  • 11
  • 16
  • How about hacking the source of leasqr? Comment out the line that emits this message. However, knowing that the optimization procedure did not converge is quite an important bit of information, IMHO. – Sven Aug 15 '13 at 17:17
  • Yeah, hacking the source would be my last resort. Not sure what to do with the non-convergence though. Better starting parameters? – jessems Aug 15 '13 at 17:45
  • That's always nice, although difficult at times. ;) Do you supply a gradient function **dFdp**, or do you use the default one? If you use the default, try reducing **dp**, 1.e-3 seems a lot IMHO. It will surely need lots more iterations, but convergence *should* improve. – Sven Aug 15 '13 at 17:51
  • I'm using the default gradient. I tried 1e-4, it became slower, but it did not improve the rate of convergence on different data sets unfortunately. – jessems Aug 15 '13 at 18:34

0 Answers0