|
From: peterchun <pet...@ma...> - 2008-10-29 00:11:48
|
Hi, I am having some problems with the fit of a straight line. I want to get a line of best fit for the 3rd column. It really should give for f(x)=m*x+c m=0 c=293255 but I get m=close to 0 c=1 I do not understand how I get a line of best fit that does not fit What am I doing wrong? Thanks Peter data: 26/08/08 293449 293255 10/09/08 296787 293255 12/09/08 296787 293255 15/09/08 296787 293255 17/09/08 296787 293255 18/09/08 296787 293255 19/09/08 296787 293255 20/09/08 296787 293255 21/09/08 296787 293255 22/09/08 296787 293255 23/09/08 296787 293255 24/09/08 296787 293255 25/09/08 296787 293255 26/09/08 296787 293255 27/09/08 296787 293255 28/09/08 296787 293255 29/09/08 296787 293255 30/09/08 296787 293255 01/10/08 296787 293255 02/10/08 296787 293255 03/10/08 296787 293255 04/10/08 296787 293255 05/10/08 296787 293255 06/10/08 296787 293255 07/10/08 296787 293255 08/10/08 296787 293255 09/10/08 296787 293255 10/10/08 296787 293255 11/10/08 296787 293255 12/10/08 296787 293255 13/10/08 296787 293255 14/10/08 296787 293255 15/10/08 296787 293255 16/10/08 296787 293255 17/10/08 296787 293255 18/10/08 296787 293255 19/10/08 296787 293255 20/10/08 296787 293255 21/10/08 296787 293255 22/10/08 296787 293255 23/10/08 296787 293255 24/10/08 296787 293255 25/10/08 296787 293255 26/10/08 296787 293255 27/10/08 296787 293255 28/10/08 296787 293255 29/10/08 296787 293255 gnuplot commands: dataset="data" set xdata time set timefmt "%d/%m/%y" set style data boxes set style fill solid 1 noborder set xrange [ "29/07/08":"29/01/09" ] set title "data" set xlabel "date" set ylabel "whatever" set grid f(x)=m*x + c fit [ "29/09/08":"28/10/08" ] f(x) dataset using 1:3 via m,c plot dataset using 1:2 title "line1", dataset using 1:3 title "line2" , f(x) title "Trendline" lw 3 -- View this message in context: http://www.nabble.com/fit-function-weirdness-tp20218720p20218720.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |