|
From: <pl...@pi...> - 2015-06-06 19:27:49
|
On 06/06/15 18:08, sfeam wrote:
> On Saturday, 06 June 2015 08:48:38 AM pl...@pi... wrote:
>
> >
>
> > I don't understand where z comes into the discussion in x,y data. :?
>
> >
>
> Digging into the history of "fit" documentation, here are extracts from
>
> gnuplot.doc for earlier gnuplot versions. (irrelevant lines trimmed)
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Version 4.2.5 (Feb 2009)
>
> Syntax:
>
> fit {[xrange] {[yrange]}} <function> '<datafile>'
>
> Ranges may be specified to temporarily limit the data which is to be fitted;
>
> any out-of-range data points are ignored. The syntax is
>
> [{dummy_variable=}{<min>}{:<max>}],
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Version 4.4.0 (Feb 2010)
>
> The `fit` command can fit a user-supplied expression to a set of data points
>
> (x,z) or (x,y,z), using an implementation of the nonlinear least-squares
>
> (NLLS) Marquardt-Levenberg algorithm.
>
> Syntax:
>
> fit {<ranges>} <expression>
>
> Ranges may be specified to temporarily limit the data which is to be fitted;
>
> any out-of-range data points are ignored. The syntax is
>
> [{dummy_variable=}{<min>}{:<max>}],
>
> The default data formats for fitting functions with a single
>
> independent variable, z=f(x), are z or x:z.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> So the change from treating the function range as "y" to treating it as "z"
>
> happened in the 4.3 development period and first appeared in the 4.4
> release.
>
> I have confirmed that the 4.4.0 executable applied "set zrange"
>
> rather than "set yrange" as a filter on data read by
>
> fix f(x) 'data'
>
> So really this discussion is about 5 years too late.
>
> We do try to maintain backwards compatibility where possible,
>
> but ...
>
> Given the ambiguity of whether the second pair of inline brackets
>
> in a fit command refers to y or z, isn't it better not to allow this at all,
>
> or issue a warning:
>
> gnuplot> fit [][ymin:ymax] f(x) 'data' via a,b
>
> Warning: bracketed range on "y" is ignored
>
> Note that the documentation has always [incorrectly!] implied that it would
>
> work to say
>
> gnuplot> fit [][z=ymin:ymax] f(x) 'data' via a,b
>
> Maybe we should fix this and *require* the z= form of the command?
>
> gnuplot> fit [][ymin:ymax] f(x) 'data' via a,b
>
> Error: Second bracketed range in a 1-parameter fit must begin with z=
>
> Ethan
Thanks Ethan.
that may be a start but I think the issue of whether this is legitimate
application of least squares regression needs to be addressed.
x is the independant variable thus any limits on the data range should
be expressed in x coordinates.
Since y ( or z ) values are assumed by the fitting algo to be error
laden using them to select a range is not valid. If there is a
need/desire to do this maybe the regression should be being done the
other way around.
There are huge problems in many fields of science from the lack of
appreciation of the assumptions and pre-conditions required for
least-squares to provide a result that is a valid estimator of the
regressed function.
Perhaps someone could suggest why this feature is there at all and in
which circumstances it can be considered a legitimate application of LSQ.
Peter.
>
> > >> It's a rather bad regression against previous versions, and one that's
>
> > >> possibly hard to spot for some people. It'd be great if the next
> release
>
> > >> contained a fix.
>
> > >>
>
> > >> Many thanks in advance, and of course to all developers!
>
> > >>
>
> > >> Best regards
>
> > >>
>
> > >> Karl
>
> > >>
>
> > >>
>
> >
>
> > setting xrange, either explicitly or via a range parameter to fit
>
> > command, works as expected.
>
> >
>
> > m=c=0.1;fit [1975:2000] lin(x) datafile u 1:2 via m,c;
>
> >
>
> > since x is by convention the independent variable and is REQUIRED to
>
> > have negligible error and negligible non linear variability to
>
> > regression to give an accurate estimation of the supposed linear
>
> > relationship, this seems appropriate.
>
> >
>
> > I don't understand where z comes into the discussion in x,y data. :?
>
> >
>
> > Trying to set the range of the fitting process by defining a range on
>
> > the dependent variable suggests it may be being applied correctly. I can
>
> > understand that the algorithm doing the fitting is based on the
>
> > assumption that x is the independent variable and that is it xrange that
>
> > defines any subset used for a particular fit.
>
> >
>
> > Maybe this needs to be stated explicitly in the documentation.
>
> >
>
> > Peter.
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
> ------------------------------------------------------------------------------
>
> > _______________________________________________
>
> > gnuplot-beta mailing list
>
> > gnu...@li...
>
> > Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
|