# Linear fitter problems in ROOT v5-28-00-patches

While trying to fit a TGraph with a “pol3”, I get (note how it “jumps”):

[code]root  g->Fit(“pol3”)

Minimizer is Linear
Chi2 = 2075.61
NDf = 464
p0 = 4.89194e+06 +/- 753524
p1 = -7394.77 +/- 1142.6
p2 = 3.72553 +/- 0.577519
p3 = -0.000625518 +/- 9.72989e-05
(class TFitResultPtr)141375584
root  g->Fit(“pol3”)

Minimizer is Linear
Chi2 = 2099.3
NDf = 464
p0 = 2.10406e+06 +/- 495473
p1 = -3167.38 +/- 751.307
p2 = 1.58883 +/- 0.379741
p3 = -0.000265534 +/- 6.3978e-05
(class TFitResultPtr)137580960
root  g->Fit(“pol3”)

Minimizer is Linear
Chi2 = 15384.7
NDf = 464
p0 = 4.07854e+07 +/- 5.93457e+06
p1 = -61821.9 +/- 8998.9
p2 = 31.2352 +/- 4.54841
p3 = -0.00526026 +/- 0.000766302
(class TFitResultPtr)145594664
root  g->Fit(“pol3”)

Minimizer is Linear
Chi2 = 2262.49
NDf = 464
p0 = 8.40135e+06 +/- 1.03222e+06
p1 = -12716.3 +/- 1565.21
p2 = 6.41525 +/- 0.791122
p3 = -0.00107867 +/- 0.000133286
(class TFitResultPtr)140055624[/code]

I also tried the “Fit Panel”.
If “Robust” is 1.00, I get:
Warning in TLinearFitter::Fitting:: illegal value of H, default is taken
and the ROOT hangs (one needs “Ctrl-Z” and “kill %1”).
I also often get tons of:
Error in TDecompChol::Decompose(): matrix not positive definite
Error in TDecompChol::Solve(): Decomposition failed
Error in TLinearFitter::Linf: Matrix inversion failed
(and the ROOT quite often likes to hang in these cases)

Hi,

The problem with the robust fitter from the fit panel has been fixed before for 5.32. If this is not the case please let me know.
Concerning your other problem, jumping results, please attach your TGraph, so I can investigate it

Best Regards
Lorenzo

Note: in this thread, I am talking about v5-28-00-patches as some other software expects it (the problem does not exist in v5-30-00-patches, I don’t have v5-32-00-patches here to test it).
The attached “test file” is also valid for the problem that I reported here: [url]Minuit versus Linear fitter in ROOT v5-30-00-patches
BTW. There seems to exist another problem. When I simply save my graph using “MyGraph->Write();”, the “associated” histogram is not saved. When I then open the ROOT file and try to “MyGraph->Draw(“AL”);”, I get a “segmentation violation” (for the moment, I simply say “MyGraph->SetHistogram(0);’” before saving it).
Graph.root (6.13 KB)

Thanks for the file, see the answer for the first question posted in