TVirtualFitter with Errors

Hi, I’m fitting a function with TVirtualFitter and I need to include the errors for the points. How do I do it with TVirtualFitter? Where is the manual for that?
This is what I’m using.

TVirtualFitter *fitter = TVirtualFitter::Fitter(0, 3);

fitter->SetParameter(0, “x0”, 0, 0.1, 0,0);
fitter->SetParameter(1, “y0”, 0, 0.1, 0,0);
fitter->SetParameter(2, “z0”, 0, 0.1, 0,0);
fitter->SetParameter(3, “R”, 1, 0.1, 0,0);

Double_t arglist[1] = {0};
fitter->ExecuteCommand(“MIGRAD”, arglist, 0);

Cheers, Eric


when fitting with the TVirtualFitter you must implement your chi2 or likelihood function and pass in the TVirtualFitter::SetFCN.
When you write the chi2 (least square) function you can include the error in the points. Normally you divide each residual by the error on the points.

Best Regards