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
 Polynomial Fitting Problem?

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
Charles.A.1 Posted - 05/01/2001 : 3:26:28 PM
I fitted a data set to a 6th order polynomial using the fitting tool and when I manually calculated the resulting plot data using the resulting equation and (hidden)data, I got different answers. I tried this procedure with a similar data set before and got a correct match up. What's the deal?
3   L A T E S T    R E P L I E S    (Newest First)
rtoomey Posted - 05/04/2001 : 09:52:15 AM
Woops! Thanks for catching that! I have updated my original post.

- rtoomey

Charles.A.1 Posted - 05/02/2001 : 5:45:13 PM
Wow! Your recommended procedure works great. Thanks alot. (By the way, your example formula for the 2nd order polynomial fit was missing a factor (i.e. col(4)=stat.pr.a + stat.pr.b1*col(3) + stat.pr.b2*(col(3)^2)).

rtoomey Posted - 05/02/2001 : 2:27:04 PM

The resulting "plot data" (i.e. the red fit curve) is generated by Origin using internally stored parameter results. These results are a lot more accurate (i.e. they have more precision to the right of the decimal point) than the results reported to the Results Log. This is most likely the reason why your manual calculations do not always match our fit results. Therefore, it is recommended that you use these internal values at ALL times (for manual calculations).



To get at them (for polynomial regression), use the stat.pr sub-object properties. In the case of a 6th order polynomial regression, the specific properties are:




- stat.pr.a
- stat.pr.b1
- stat.pr.b2
- stat.pr.b3
- stat.pr.b4
- stat.pr.b5
- stat.pr.b6


As a simple example, suppose you have just performed a 2nd order polynomial fit. You now have access to stat.pr.a, stat.pr.b1, and stat.pr.b2. Suppose further that column 3 of the active worksheet is an X column which is full of arbitrary values. To calculate the 2nd order polynomial result using that X column and then place it in column 4, you could execute the following in the Script window (or the right-hand side of it in the Set Column Values dialog box after selecting column 4 and Column:Set Column Values):

col(4)=stat.pr.a+stat.pr.b1*col(3)+stat.pr.b2*(col(3)^2);

Note: If you were performing a linear fit, the stat.lr sub-object would need to be used. If you were performing a nonlinear fit, the nlsf object would need to be used. Objects, object properties, and object methods are all described in the LabTalk Manual and LabTalk Help File (Help:LabTalk).

I hope this information proves helpful.

- rtoomey



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