# ROOT.Math.Minimizer

**URL:** <https://root-forum.cern.ch/t/root-math-minimizer/53268>\
**Category:** Newbie\
**Created:** [January 25, 2023, 3:13pm UTC](https://root-forum.cern.ch/t/root-math-minimizer/53268 "2023-01-25T15:13:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![L\_N](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/l_n/32/32251_2.png) [@L\_N](https://root-forum.cern.ch/u/L_N)\
**Post date:** [January 25, 2023, 3:13pm UTC](https://root-forum.cern.ch/t/root-math-minimizer/53268/1 "2023-01-25T15:13:46Z")

</div>

Hello,

I have some questions about the ROOT.Math.Minimizer.  
So, if I understood correctly the least squares (or Chi2?) are minimized here, is that correct?  
Then, I found online that one should use the numerical (default) precision ROOT.Math.MinimizerOptions.SetDefaultPrecision(1e-16) and not a value below or above, is that right?

Thanks a lot in advance and cheers!

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 25, 2023, 3:18pm UTC](https://root-forum.cern.ch/t/root-math-minimizer/53268/2 "2023-01-25T15:18:07Z")

</div>

Welcome to the ROOT forum

I think @moneta can help you with this question.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [January 26, 2023, 8:30am UTC](https://root-forum.cern.ch/t/root-math-minimizer/53268/3 "2023-01-26T08:30:00Z")

</div>

Hi,

The `Minimizer` class can minimise any function and his includes the `Chi2` function. If you have a set of data points, you can also use the `ROOT::Fit::Fitter` class which will create internally for you the Chi2 function. See [ROOT: ROOT::Fit::Fitter Class Reference](https://root.cern.ch/doc/master/classROOT_1_1Fit_1_1Fitter.html).

Cheers

Lorenzo
