# Getting negative chi sq value, but the fit looks good?

**URL:** <https://root-forum.cern.ch/t/getting-negative-chi-sq-value-but-the-fit-looks-good/54281>\
**Category:** Roofit and RooStats\
**Created:** [March 29, 2023, 12:31pm UTC](https://root-forum.cern.ch/t/getting-negative-chi-sq-value-but-the-fit-looks-good/54281 "2023-03-29T12:31:13Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Eddy\_Offermann](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eddy_offermann/32/25079_2.png) [@Eddy\_Offermann](https://root-forum.cern.ch/u/Eddy_Offermann)\
**Post date:** [March 31, 2023, 8:15pm UTC](https://root-forum.cern.ch/t/getting-negative-chi-sq-value-but-the-fit-looks-good/54281/7 "2023-03-31T20:15:02Z")

</div>

Dear @Subhu18,

Let me start with a disclaimer: I am clueless about RooFit 😉 but …

Fitting two Gaussians at the same position but different widths is a very difficult task for any fitter; and it shows in your correlation matrix with off-diagonal elements close to 1 and even one negative diagonal element.

The chi-square of exactly -1 means probably that the underlying optimization algorithm bailed out because some matrix was not positive definite.

How would one distinguish between 2 Gaussians (allowing a fatter tail) and a Hyper-Gaussian shape ([see for description](https://root-forum.cern.ch/t/tspectrum-and-something-else/48946/7) )

-Eddy

---

_[View the full topic](https://root-forum.cern.ch/t/getting-negative-chi-sq-value-but-the-fit-looks-good/54281)._
