Fitting graph with error on both axis

Hello, I’ve got a problem fitting a Graph with errors in x-values and y-values. ROOT takes only the errors on the y-values to fit, the error on the x-values are ignored by ROOT, doesnt matter how big they are.
I fit with the:
(g is the Graph)

g->Fit(“pol1”)

Can u help me out?

Errors in x are taken into account during the fit.
Are you using a TGraph, TGraphErrors, …?
Could you send the shortest possible RUNNING script reprpducing your problem?

Rene

“F” If fitting a polN, switch to minuit fitter (by default, polN functions are fitted by the linear fitter)
g->Fit(“pol1”,“F”)
minuit takes both (x, y) errors

Jan

{
gROOT->Reset();
//Testarrays
Double_t x[] = {1.2,2.4,5.4};
Double_t y[] = {1.2,5.4,7.4};
Double_t sigx[] = {1.2,2.4,5.4};
Double_t sigx2[] = {0,0,0};
Double_t sigy[] = {1.2,2.4,5.4};

TGraphErrors *g = new TGraphErrors (3,x,y,sigx,sigy);

gStyle->SetOptFit(111);
g->Fit(“pol1”);
g->Draw(“A*”);
}

that’s our problem reduced to some lines with a sample array as u wished.
It doesnt matter for the parameters of “pol1” if u take “sigx” or “sigx2” !?

thanks
Jonas

Thanks musinsky, it works!
Thanks Rene for help!
Jonas