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
 Origin Forum
 NLFit converges weirdly

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
th0 Posted - 07/09/2019 : 05:03:30 AM
Origin Ver. and Service Release (Select Help-->About Origin): b9.5.0.193
Operating System: win10

Hi there,
I am using the NLFit to fit stretched exponential data. In the past, this always worked and on an older Origin version the presented data is not problematic.

What I have: A copy of the ExpDec1 that includes an arbitrary stretched exponential parameter:
y = A1 * exp((-x/t1)^b1) + y0
I force b1 to be 1 in the beginning. This fitting function works nice on an Origin from 2015 or so. It is also used in this forum: https://my.originlab.com/forum/topic.asp?TOPIC_ID=40795 (though I do not understand what is his problem there).

Origin tells me that the fit does converge without performing any fitting - it takes the calculated initial parameters and claims that the fit converged after the first iteration:
---
(49) ----------Levenberg-Marquardt-----------
Reduced Chi-sqr = 0.0021043241167
COD(R^2) = 0.97233115725141
Iterations Performed = 1
Total Iterations in Session = 1
(50) Fit converged. Chi-Sqr tolerance value of 1E-9 was reached.
---

However, the fit obviously did not converge. If I set the starting value of b1 to anything but 1, Origin errors after 0 iterations that the fit does not converge:
---
(51) ----------Levenberg-Marquardt-----------
Reduced Chi-sqr = 0.100196807768
Iterations Performed = 0
Total Iterations in Session = 1
(52) Fit did not converge - reason unknown.

---

If I change the fitting function to look like this:
y = A1 * exp((-x^b1/t1)) + y0

everything works fine:
---
(56) ----------Levenberg-Marquardt-----------
Reduced Chi-sqr = 5.79336207538E-5
COD(R^2) = 0.99923825601305
Iterations Performed = 78
Total Iterations in Session = 78
(57) Fit converged. Chi-Sqr tolerance value of 1E-9 was reached.
---

but then in order to get the correct t1 I have to manually calculate t1^b1, which is of course possible, but not convenient.

Any leads?
2   L A T E S T    R E P L I E S    (Newest First)
th0 Posted - 07/09/2019 : 05:47:03 AM
Hi!
Thanks for your quick reply and the solution. I was focused on the fact that the fit converges and did not consider an error in the fitting function, but at second glance it's rather obvious.

I cannot update to 2019 as I'm on an institutional license and we just have what we have. But thanks for hinting to the library, when we update next year I will certainly use it.

th0
AmandaLu Posted - 07/09/2019 : 05:39:25 AM
Hi,

The fitting function is wrong, please use this one:

y = A1 * exp(-(x/t1)^b1) + y0

BTW, this function is included in Fitting Function Library App. You are welcome to upgrade to Origin 2019 and try this App:

https://www.originlab.com/fileExchange/details.aspx?fid=490

Thanks,
Amanda
OrigjinLab Technical Service

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