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 *fitter = TVirtualFitter::Fitter(0, 3);

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


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

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

Best Regards