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
 Orthogonal Distance Regression

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/20/2017 : 04:40:16 AM
Hello everyone,
I found out there is a new functionality in OriginPro 2017 called "Orthogonal Distance Regression" (http://www.originlab.com/doc/Tutorials/Nonlinear-fitting-using-orthogonal-regression).
Could someone provide an example in OriginC (or LabTalk) how to use it for data fitting with some function built in Origin, e.g., "Power1"?
Many thanks for your help in advance!

PS: At the bottom of the page above, there are two links available in "You can refer to this page for the details of the algorithm of ODR as well as Levenberg Marquardt (L-M) algorithm. Another example of using Orthogonal Distance Regression for Implicit Functions can be found here." The first one does not contain any OriginC example and the second one is broken.
---
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2017 (64-bit), b9.4.0.220
Operating System: Windows 10 Pro (64-bit)
3   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 01/22/2017 : 01:06:39 AM
Hi J,

Glad to hear that you resolved the problem.

Yes, we can specify the iteration algorithm by method NLFitSession::Iterate:
http://www.originlab.com/doc/OriginC/ref/NLFitSession-Iterate

Regards,
Yuki
OriginLab
j@y Posted - 01/20/2017 : 11:44:12 AM
Hello Yuki,
Problem solved. Using "nlfSession", the "Orthogonal Distance Regression" can be selected by declaring "FITMETH_ORTHOGONAL_DISTANCE_REGRESSION". Still, it does not do what I would expect. Have to tune "SetParamBounds" and "SetTolerance"...
All the best. j
yuki_wu Posted - 01/20/2017 : 06:05:37 AM
Hi,

I just come up with an example by using the X-Funtion xop:

//First import the desirable data into a new book
 
filename$ = system.path.program$ + "Samples\Curve Fitting\Gaussian.dat";
 
newbook;
 
impASC filename$;
 
//Use the NLSF class to create a GUI tree "nlGUI"
tree nlGUI;
xop execute:=init classname:=FitNL iotrgui:=nlGUI;
 
//Specify function and input data, then update operation tree before fitting.
 
nlGUI.GUI.FunctionSelection.FunctionList$="Gauss";

nlGUI.GUI.FunctionSelection.fitmethod=1; //Use ODR
 
nlGUI.GUI.InputData.Range1.X$=Col(A);
 
nlGUI.GUI.InputData.Range1.Y$=Col(B);


xop execute:=update iotrgui:=nlGUI;

xop execute:=report iotrgui:=nlGUI;
 
//Clean up operation objects after fit
 
xop execute:=cleanup;

More information about xop can be found here:
http://www.originlab.com/doc/X-Function/ref/xop

Not sure whether it is what you want. If I figure out another better example, I will get back.

BTW, the broken link has been repaired.

Regards,
Yuki
OriginLab

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