| Author |
Topic  |
|
|
peroma
Germany
26 Posts |
Posted - 06/29/2004 : 12:32:51 PM
|
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
|
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
|
 |
|
|
peroma
Germany
26 Posts |
Posted - 06/30/2004 : 03:32:24 AM
|
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 |
 |
|
| |
Topic  |
|
|
|