Re: How to fit data in a restricted range?



On Mon, 19 Jun 2006 18:26:14 +0000
Tom <xxx@xxxxxxxxxx> wrote:


I am only a basic level gnuplot user. I know plot command, f(x)= etc.
But the fitting is to fit the whole range of data. I hope to learn how
to fit only the selected range of data. Of course, one way is to delete
the un-wanted data range in the original data file and only plot the
selected data. But I hope there is some better way. Thank you very much
for your help.

If you use an OS which implements pipes (|), like Linux, for instance,
you can filter your data with an external program before passing it to
gnuplot fitting function. You can choose among several alternatives,
but for this kind of stuff I find (g)awk unbeatable. Assuming your data
file is "my.dat", and assuming you want to fit only the points with x
values between 1 and 10, you can use (g)awk to filter your data like
this

fit a*x+b "< gawk '{if($1>1 && $1<10) print $0}' my.dat " via a,b

(caveat: I wrote this without checking if it actually works) for a
brief description of what's going on, check

gnuplot> help special-filename

A "man gawk" (or "man awk") will give you all the necessary details...
and many more!

Hope this could help.

Giulio.
.



Relevant Pages

  • Fitting parameter errors (compared to NAG-library)
    ... why do I get different parameter errors when fitting ... with gnuplot and with the NAG library? ... covariance matrix). ... this is a superfluous discussion in this case) are 0 and that the fit ...
    (comp.graphics.apps.gnuplot)
  • multidimensional fitting
    ... I have a further problem with fitting in gnuplot. ... I want to fit a multidimensional dataset dataset, ...
    (comp.graphics.apps.gnuplot)
  • Re: Update Query; But keep rest of field...
    ... Left$ and Right$ act like a scissors, counting from left or right, and cutting the string at that point, returning just that portion of the string. ... Comparing "Fitting ABS" with Left$will tell you if the beginning matches the eleven characters in "Fitting ABS". ... Will take "Fit ABS", and add everything except the first eleven characters, of tblItem.to it. ... Using the Design View to create a query, ...
    (microsoft.public.access.queries)
  • Re: Update Query; But keep rest of field...
    ... Using the Design View to create a query, ... UPDATE tblItem SET tblItem.itemMfgItemNumber = "Fit ABS" ... The goal is to find all items that START with "Fitting ABS" and change them ... Fitting PVC Sch40 1" 90 ELL SxS ...
    (microsoft.public.access.queries)
  • Re: Singular matrix in Invert_RtR
    ... Singular matrix in Invert_RtR ... The problem is that Gnuplot's fit uses a procedure known as Marquard-Levenberg algorithm, ... There is an alternative fitting algorithm, Simplex by Nelson & Mead, which is much more stable and can also minimise Chi^2 or the median of residuals in those cases where minimising the sum of squares is statistically inappropriate. ... Unfortunately, Simplex can not directly calculate the standard deviations for the parameters, that is probably the reason why many scientific fitting programs do not use it. ...
    (comp.graphics.apps.gnuplot)

Loading