|
From: Francois M. <ma...@lp...> - 2015-04-08 19:04:01
|
Hi Sunil, If you work on some kind of Unix system, you should be able to use: <pre> set grid set xrange [0:150] set yrange [0.5:1.5] plot "a.data" title "All datapoints" with errorbars pause -1 "Hit [Enter] to continue..." # A dummy fit function: a=0.15 b=0.8 phi=-2.5 w=0.07 f(x)=a*sin(w*x+phi) + b set samples 2000 # Plot only "Good" datapoints from the data file (a.data): plot "< awk '$3 < 0.1' a.data" title "Good datapoints" with errorbars, f(x) title "Guess" pause -1 "Hit [Enter] to continue..." # Fit only "Good" datapoints : fit f(x) "< awk '$3 < 0.1' a.data" via a,b,phi,w plot "< awk '$3 < 0.1' a.data" title "Good datapoints" with errorbars, f(x) title "Best fit" pause -1 "Hit [Enter] to continue..." </pre> However, removing such datapoints with large errors should not change a lot the result of the fit in term of the computing of best-fit parameters for your function because their weight is rather tiny when computing the LS statistics. A more serious point is that this procedure will arbitrarily change the number of degrees of freedom of the fit and thus the P-value associated to the fit (so the acceptance region for your hypothesis) will be biased wrt to the original dataset. This kind of approach is generaly not fair unless you can justify why you remove such points and not other ones. HTH Best regards frc -- |