The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 NLFitSession not powerful enough

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000