# Chi-square definition in ROOT

**URL:** <https://root-forum.cern.ch/t/chi-square-definition-in-root/51083>\
**Category:** Newbie\
**Created:** [August 5, 2022, 4:35pm UTC](https://root-forum.cern.ch/t/chi-square-definition-in-root/51083 "2022-08-05T16:35:43Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 8, 2022, 7:23am UTC](https://root-forum.cern.ch/t/chi-square-definition-in-root/51083/9 "2022-08-08T07:23:18Z")

</div>

> [@moneta](#):
>
> In the case of binned likelihood fit I agree this is confusing, it returns the Neyman chi2 using your fitter function.

This is not the case.  
See the numbers in my first post here (“`Neyman chi2 = 7.94587`” versus “`f->GetChisquare()`” which returns “`8.2006239`” ).

It seems this has already been raised a year ago or so (you fixed something but it’s still incorrect):

> [@Getting details of a gaussian fit](https://root-forum.cern.ch/t/getting-details-of-a-gaussian-fit/45580/8):
>
> @moneta In [your example macro](https://root-forum.cern.ch/t/getting-details-of-a-gaussian-fit/45580/6), if you set “gStyle-\>SetOptFit();”, in the “statistics box” of the “Maximum Likelihood Fit” you will see “chi2 / ndf” which is completely different from “2 \* FCN”. The value that is displayed is the same as returned by “result2-\>Chi2()”.

---

_[View the full topic](https://root-forum.cern.ch/t/chi-square-definition-in-root/51083)._
