I have three data sets: data1=(t, x, xerror), data2=(t, y, yerror), data3=(t, z, zerror) and I want to fit them with each other: data3 = a * data1 - b * data2 (need to fit for a and b). However, I have no idea how to organize it in gnuplot. I tried to combine all the data into a single file, drop t (as it is not ``directly participating'' in fitting function): (x, xerror, y, yerror, z, zerror) and fit as follows
f(x)=a*x-b*y
a=1
b=1
fit f(x,y) 'data.dat' u 1:2:3:4:5:6 xyerror via a, b
however it says Need via and either parameter list or file. Then I dropped errors and just fit as
fit f(x,y) 'data.dat' u 1:3:5 via a, b
and get some nonsense fit with nan's. How this could be properly fitted?
Thank you in advance!
UPD the data in question is the following (without errors - using 1:2:3)
0 0 0
1.93333e+09 0 0.368098
2.89333e+10 3.01333e+09 1.81217
1.00267e+11 1.01467e+10 2.34236
1.36267e+11 1.868e+10 1.62783
1.34933e+11 1.86133e+10 0.341428
1.376e+11 1.88133e+10 0
1.34933e+11 1.868e+10 0
so that first column is x, second is y and third is what I want to fit with a*x-b*y