Hello!
I have a problem with fitting my data with Cauchy distribution.
I’ve done fitting many times and have really no idea what’s wrong this time.
In fit results i get “0 +/- nan” in my parameters, a very small NCalls and no red line on graph that shows the fit.
I’ve checked if i set a good range and it’s ok.
Maybe the problem is that data is quite big(16000 datapoints) but i don’t know how to check it.
my code:
data = new TGraph(“datafile.txt”);
fc = new TF1(“fc”, “TMath::CauchyDist(x, [0], [1])”, 1.3, 1.7);
data -> Fit(fc, “R”);
data -> Draw();
In ROOT, before you try to fit your graph or histogram, you MUST set “reasonable” initial values for ALL parameters of your function (except for some “built-in” formulas, like “gaus”, for which the standard fit procedure can automatically “guess” them), otherwise the fitting procedure may easily misbehave.