TVirtualFitter + 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::SetDefaultFitter(“Minuit”);
TVirtualFitter *fitter = TVirtualFitter::Fitter(0, 3);
fitter->SetFCN(myfcn);

fitter->SetParameter(0, “par1”, 0, 0.1, 0,0);
fitter->SetParameter(1, “par2”, 0, 0.1, 0,0);
fitter->SetParameter(2, “par3”, 0, 0.1, 0,0);
fitter->SetParameter(3, “par4”, 1, 0.1, 0,0);

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

Cheers, Eric

HI,

if you are fitting directly with the TVirtualFitter you have to write yourself the function to minimize.
See for example how the fcn function is implemented in this tutorial

root.cern.ch/root/html/examples/Ifit.C.html

However, if you are fitting just data points with uncorrelated errors, I would recommend you to do it via the TGraphErrors class.

Best Regards

Lorenzo