Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMFnlsq.m fails #47

Open
RobHolman opened this issue Jun 9, 2018 · 1 comment
Open

LMFnlsq.m fails #47

RobHolman opened this issue Jun 9, 2018 · 1 comment

Comments

@RobHolman
Copy link
Member

Diana Di Leonardo struggled with run times (and some other problems) using the new LMFnlsq routine. In fact, she found an infinite loop when supplied with bad inputs. This would not be caught in the try-catch. She also implies that other changes were needed. She sent the following to me by email: @mpalmsten,@KateBrodie, @SRHarrison

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
As we discussed, I found an infinite while loop in the non-linfit version of cBathy.

I had to make a few changes to the supporting codes to make it all work without the statistics toolbox.

csmInverstKAlpha comment out line 44 and line 112
bathyFromKAlpha comment out line 14

These are all references to statset.

bathyCI line 40 changes from ~isempty to isempty à this seems like it might be a typo

For xm 590 and ym 450, there is an infinite while loop inside LMFnlsq.m
The while loop starts at line 324 and seems to be caused by having a kAlphaInit input of [NaN NaN NaN]. When I reset this input to values form a successful point, the while loop terminated correctly.

I’m happy to try more things and might continue to poke around.

Best,
Diana

@RobHolman
Copy link
Member Author

@jstanleyx @mpalmsten @KateBrodie @SRHarrison. Diana sent me this issue only because I was sitting next to her at the boot camp as she struggled with what eventually turns out to be an infinite loop in the new LMFnlsq.m code. I looked quickly at the routine in the area of the while loop starting at line 324 and it seems like ugly coding to me (lots of "while 1" then break out of loops) and obviously it isn't robust to odd inputs, the stuff that matlab handles carefully. It feels like the best choice is to put QC somewhere earlier. This isn't an area of strength or interest to me. Any volunteers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants