T O P I C R E V I E W |
j@y |
Posted - 01/21/2017 : 08:12:56 AM Hi everyone,
I struggle with using 'NLFitSession' in OriginC. Suppose I want to fit 'Power1' function, i.e., y = a*|x-b|^c to my data. Sometimes, I want to fit all three parameters, sometimes, I set 'c' as fixed and want to find 'a' and 'b'. All 'a', 'b' and 'c' are, in principal, real.
In any case, I have to impose constraints through "SetParamBounds", otherwise the fit ends up with nonsensical results. However, likely due to those constraints, the 'NLFitSession' often stops shortly after its start without changing the initial guess values much or at all, or it gets stuck at some local, incorrect extremum (often one of the parameters is equal to one of the bounds and the rest of parameters do not even correspond to the appropriate extremum when fitting stops). But since I can fit the data elsewhere, I know a reasonable solution exists.
Is there some way how to make the 'NLFitSession' more robust so that it tests the results in the course of iterations whether it really is the global extremum? Or is it completely up to the user to, e.g., intentionally randomize the parameters in the course of iterating to ensure the process does not stop in a local extremum? Or am I overlooking some other function for non-linear fitting which is available in Origin? As far as I know, Mathematica or National Instruments SW incorporate much more powerful a faster optimization engines that take care of all that.
Many thanks for any suggestion and sharing your experiences... --- OriginPro 2017, Win 10 Pro |
3 L A T E S T R E P L I E S (Newest First) |
yuki_wu |
Posted - 01/22/2017 : 03:00:09 AM Hi J,
I knew what you were talking about. I just suggested you could try the NLFit dialog in Origin’s GUI to see if you would run into the same issue, so that we would know more info to figure out what went wrong.
If you are sure you can do fitting perfectly in NLFit dialog, would you mind sending us your code and data file with a note mentioning this forum post?
You can find the contact information here: http://www.originlab.com/index.aspx?go=COMPANY/ContactUS
Regards, Yuki OriginLab
|
j@y |
Posted - 01/22/2017 : 02:31:49 AM Hi Yuki, well, setting parameter bounds via 'nlfitssession.SetParamBounds' is what I am using (see the 2nd paragraph), and it is a kind of constraints, too. The data are what they are. It has no meaning to discard 99 % of data just because Origin cannot fit them...  |
yuki_wu |
Posted - 01/22/2017 : 02:09:19 AM Hi J,
Not sure whether the problem is caused by wrong data. Perhaps you should check your data at first. You can run the fitting in Origin’s GUI to fit one of the dataset, and then check if you run into the same issue.
In Origin’ GUI, it is strongly recommended to set the parameter bounds in the Bounds tab of NLfit dialog instead of in the Constraints item of Code tab.

Regards, Yuki OriginLab |
|
|