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
 LabTalk Forum
 Get coefficients in polynom fitting

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
JokerOne Posted - 02/18/2016 : 09:55:54 AM
Origin Ver. 9 and Service Release 1(Select Help-->About Origin):
Operating System: Win 7

I am trying to fit some data using polynoms with varying order.
In the documentation I found two option in doing so using LabTalk:

1.) polyfit X-function: http://www.originlab.com/doc/LabTalk/guide/Linear-Fitting#Polynomial_Regression

This was perfect, if not the fact, that I like to investigate the sum of the squared residuals. If am am correctly, this value is not provided in the output of polyfit.
However, the polynom coeffients are sorted nicely in a dataset.

2.) Using xop and the FitPolynomial class as described here:
http://www.originlab.com/doc/LabTalk/examples/Curve-Fitting#Polynomial_Fit

This looks very nice, as one has access to basically every result value you can think of, BUT, here, the coefficients are sorted seperately in the result tree structure.
As also given in the example one has to "pick" every coefficient, like:

// Get the coefficients from the output tree
coef1[1] = polyOut.Parameters.Intercept.Value;
coef1[2] = polyOut.Parameters.B1.Value;
coef1[3] = polyOut.Parameters.B2.Value;
coef1[4] = polyOut.Parameters.B3.Value;

I would prefer to use option 2, however, when I want to use varying polynom orders, I guess, that I somehow have to cope with this mentioned issue.
Is there an easy way, like a magical function:
GetCoeff(result_tree) ?
Otherwise, I guess I will have to write a huge Switch-structure, switching through all possible orders or so...?

Thanks for your help






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