|
From: sfeam <sf...@us...> - 2015-06-06 21:58:42
|
On Saturday, 06 June 2015 06:59:45 PM pl...@pi... wrote: > > > > gnuplot> fit [][ymin:ymax] f(x) 'data' via a,b > > Warning: bracketed range on "y" is ignored > > > > or > > > > gnuplot> fit [][ymin:ymax] f(x) 'data' via a,b > > Error: Second bracketed range in a 1-parameter fit must begin with z= > > > 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. >From a data-centric viewpoint, I don't think I buy that argument. When both x and y are experimentally determined values, why should you be able to limit the acceptable range of one but not the other? > Since y ( or z ) values are assumed by the fitting algo to be error > laden using them to select a range is not valid. I do not follow your line of thinking there, unless you are suggesting that the limit should be applied to (y +/- yerror) rather than to y. Anyhow, there can also be errors associated with x. I realize the default form of the fit command does not handle errors on x, but version 5 introduced an option "fit xyerror" that does. > 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. If you mean "why do we allow bracketed ranges in the fit command?" the only justification I see is backwards compatibility. I recommend against using bracketed ranges in any of the commands, 'plot', 'fit', or 'stats'. If you mean "why do we allow filtering on z range?", I think that is a case of providing a tool and leaving it up to the user to make responsible use of it. I don't use gnuplot's fit routine that much, and when I do I usually pre-filter the data in an external tool before giving it to gnuplot. But there are times when it is convenient to filter on the range of either x or y in 2D experimental data, or on the range of all observed values in higher dimensional data. Ethan |