On 14.05.2011 13:06, Petr Mikulik wrote:
> A colleague has noticed wrong parameter values after 2D fitting via
> fit f(x,y) 'data.txt' us 1:2:3 via a,b,c
>
> Gnuplot was fitting correctly after adding the dummy weight column as
> "help fit" indicates:
> fit f(x,y) 'data.txt' us 1:2:3:(1) via a,b,c
>
> I think gnuplot should write an error of not having enough columns or
> missing weights column in the former command or it should fill weights by
> one if the 4th column is missing.
That idea is based on a misconception. The problem at hand is not that
gnuplot didn't fill in the weights --- it's that the user incorrectly
believed the first command given above were a 2-variable fit (somewhat
incorrectly referred to as a "2D" one), which it's not. That's a
perfectly valid command to perform a 1-variable fit (assuming a variable
'y' was defined before) that, and gnuplot has no way of knowing that's
not what the user wanted.
I.e. there is no "missing" column specification here, so nothing to
diagnose.
|