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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 poly-function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peroma

Germany
26 Posts

Posted - 06/29/2004 :  12:32:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

I have got a problem with the "poly"-function in Origin:
I performed a polynomial regression and wanted to plot the regression data with the following line:

data1_C = poly(data1_A, stat.pr.a, stat.pr.b1, stat.pr.b2, stat.pr.3);

The data in data1_C were obviously nonsense for the were miles away from the original dataset.

With the lines:

data1_C= stat.pr.a;
loop (i, 1, 3) {data1_C=data1_C+ stat.pr.b$(i)*data1_a^i};

The parameters of the fit were:
STAT.PR.A=74,29484
STAT.PR.B1=-17,74396
STAT.PR.B2=-6812,026
STAT.PR.B3=134863,5

and the range of data1 was 0.003 to 0.028.

What it the reason for this big difference?

I'm very curious

Peter

easwar

USA
1965 Posts

Posted - 06/29/2004 :  1:52:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Peter,

Looks like what you are trying to do is generate a fit dataset for the poly fit, at the same x values as the raw data.

I see that your first script line has a typo: should be stat.pr.b3 and not stat.pr.3

You second script segment should do the same thing as the first script line, and either one should give you the correct result.

Are you saying that neither gives the correct result? Does the original fit line (created by the polynomial fit menu/tool )follow your data well? And the computed dataset is way off the data as well as the original fit line?

If yes, please paste dataset here - if not too large, or send to tech@originlab.com. If you send in the data, please mention this posting.

Easwar
OriginLab




Go to Top of Page

peroma

Germany
26 Posts

Posted - 06/30/2004 :  03:32:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar,

it was the typo that screwed everything up. The parameters were identical to those created with polynomial fit from the menu. So the result from the loop was the correct one.

Thanks so much
Peter
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000