Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Gnuplot interactive function plotter > error fitting s...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3361 of 3630
Post > Topic >>

error fitting straight line.

by googoff@[EMAIL PROTECTED] Jun 17, 2008 at 01:37 AM

Hi,

I must be being blind here but I can't see my error. I have the
following snip to plot some data, a fitted line and the difference
from that fitted line:


c=0;m=1;
f(x)=x*m+c;
fit f(x) datafile using 1:2 via m,c;


set terminal svg size 800 600
set output "dac-2008.svg"
plot datafile  using 1:(($2)/1.0) w l title "resampled DAC output"\
, f(x) with lines title "lin. regression fit"  \
, datafile using 1:( ($2-f($1))*1.0 ) title "difference error"
 ;
unset output


The DAC output and the fitted line come out as expected but the
difference seems the same as the first plot implying that the function
is evaluating to zero in my difference line.

Looking at the output of gnuplot as it does the fit would explain this

Final set of parameters            Asymptotic Standard Error
=======================            ==========================

m               = 5.78027e-05      +/- 6.513e-08    (0.1127%)
c               = 0.00413971       +/- 0.002064     (49.86%)


What I can't understand is that the plots correctly, y data goes 0-3 ;
x data 0-16 , so my slope should be about 0.2

The odd thing is the plot of f(x) look perfect and does not have a
slope of 6e-05

Must be something silly I'm overlooking .

TIA for any help.
 




 3 Posts in Topic:
error fitting straight line.
googoff@[EMAIL PROTECTED]  2008-06-17 01:37:22 
Re: error fitting straight line.
googoff@[EMAIL PROTECTED]  2008-06-17 01:52:00 
Re: error fitting straight line.
Ton 't Lam <ton.tlam@[  2008-06-17 19:28:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 20:22:08 CST 2008.