# How to perform least square and modified least square fit using ROOT?

**URL:** <https://root-forum.cern.ch/t/how-to-perform-least-square-and-modified-least-square-fit-using-root/52956>\
**Category:** ROOT\
**Tags:** root\
**Created:** [January 1, 2023, 2:23am UTC](https://root-forum.cern.ch/t/how-to-perform-least-square-and-modified-least-square-fit-using-root/52956 "2023-01-01T02:23:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 1, 2023, 7:54am UTC](https://root-forum.cern.ch/t/how-to-perform-least-square-and-modified-least-square-fit-using-root/52956/2 "2023-01-01T07:54:58Z")

</div>

Search for “`Neyman`”, “`Pearson`”, and “`Baker`” (or “`Cousins`”) `chi-square` in the [TH1 Class Reference](https://root.cern/doc/master/classTH1.html) (and/or elsewhere).

See also:

> [@Chi-square definition in ROOT](https://root-forum.cern.ch/t/chi-square-definition-in-root/51083):
>
> Hi All, My co-worker and I, using different tools, were trying to fit some histograms. Surprisingly, we found the chi2 of our results were different by 1.5 to 2 times. Here is a toy histogram for example: Bin centres: [0.025, 0.075, 0.125, 0.175, 0.225, 0.275, 0.325, 0.375, 0.425, 0.475, 0.525, 0.575, 0.625, 0.675, 0.725, 0.775, 0.825, 0.875, 0.925, 0.975] Bin edges: [0., 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.] Bin heights: […

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-perform-least-square-and-modified-least-square-fit-using-root/52956)._
