0
votes

I want to do a multi-branch fit with gnuplot. I have a set of data containing values for xyerror the following data.

x y1 dx dy1

x y2 dx dy2

I was able to do a fit without x and y errors.

fit f(x,y) 'files.dat' using 1:-1:2 via a,b,c

I want to know how to do a multi-branch fit with x and y errors?

Thank you in advance

1

1 Answers

0
votes

As far as I can tell your case is already mentioned in the gnuplot manual about fit:

As an example, if one has 2 independent variables, and errors for the first independent variable and the dependent variable, one uses the errors x,z qualifier, and a using qualifier with 5 columns, which are interpreted as x:y:z:sx:sz (where x and y are the independent variables, z the dependent variable, and sx and sz the standard deviations of x and z).

x ("x" in your data file) and y (line number) are your two independent variables, z ("y" in your data file) is the dependent variable. For your case the fit command should look like

fit f(x,y) 'files.dat' using 1:-1:2:3:4 errors x,z via a,b,c