3

apologies if this is a very simple question, but I have searched everywhere and can't find a solution. I have a data file with three columns - x:y:xerrors. I want to fit a function f(x) to the data, by entering

f(x)=a*x+b
fit f(x) 'data' using 1:2:3 via a,b

But is this fit assuming that the entries in column 3 are y-errors, when actually they are x-errors?

1
  • Have you had a look at this? Commented Mar 10, 2014 at 18:28

2 Answers 2

2

Change: fit f(x) 'data' using 1:2:3 via a,b

To: fit f(x) 'data' using 1:2:3 with xerrorbars via a,b

This treats the 3rd column as the uncertainty in x and computes an appropriate weight for the WSSR.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes the fit assumes that the 3rd column is y-error if you specify using 1:2:3 else (if you do NOT specify) it assumes all weight equal to 1.

Meanwhile we wait the patch will be included in all the gnuplot distribution, I can propose a Workaround: # y=ax+b --> x=1./a*(y-b)

f(x)=a*x+b

f2(x)=1./a * (y-b)

fit f2(x) 'data' using 2:1:3 via a,b

plot 'data' with xerrorbar, f(x)

of course this changes the meaning of the uncertainty associated with a and b. See here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.