# ROOT::FIT, parameter error propagation

**URL:** <https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778>\
**Category:** ROOT\
**Created:** [February 17, 2017, 12:37pm UTC](https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778 "2017-02-17T12:37:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![atd](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atd/32/33835_2.png) [@atd](https://root-forum.cern.ch/u/atd)\
**Post date:** [February 17, 2017, 12:37pm UTC](https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778/1 "2017-02-17T12:37:35Z")

</div>

Dear rooters,

I’m still new to the ROOT::FIT classes. In some of the fits, several parameters are kept fix; but they have an associated error.

In order to propagate these errors (associated with the fix parameters) to the “free” parameters, I have to perform several fits changing the values of the fixed parameters (a Montecarlo way of propagating errors).

So, my question is: is there a way using ROOT::FIT to propagate the errors of the fixed parameters?

I spent a while looking for it, but I didn’t find anything. So, in case of a negative answer, is there any more stylish way of propagating the errors? (I can provide a “simplified working code” if needed).

Thank you for your time.

Greetings.

---

<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:** [February 22, 2017, 9:16am UTC](https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778/2 "2017-02-22T09:16:23Z")

</div>

Hi,

The correct way to include the uncertainty on those parameter is to include an additional term in the likelihood, such as a Gaussian constraint.  
This is not foreseen actually in ROOT::Fit, but it is not complicated to do it by extending the negative log-likelihood with a quadratic term in the parameter (the log of a gaussian) and then use the ROOT::Fitter::FitFCN function to perform the fit.  
If you need I could make an example for you

Best Regards

Lorenzo

---

<div class="post-metadata">

**Author:** ![atd](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atd/32/33835_2.png) [@atd](https://root-forum.cern.ch/u/atd)\
**Post date:** [February 24, 2017, 9:30am UTC](https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778/3 "2017-02-24T09:30:15Z")

</div>

Hello

I would be grateful if you could make an example of the propagation of systematic errors.

I have simplified an example, if you don’t want to make it from scratch.  
[propagateSystematicErrors.C](https://root-forum.cern.ch/uploads/default/original/2X/a/a134517ba23c11c00e83ec58063721ee12ce9ca9.C) (2.2 KB)

Thank you for your time 🙂

Best regards,  
Alvaro.

---

<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:** [February 27, 2017, 3:33pm UTC](https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778/4 "2017-02-27T15:33:00Z")

</div>

Hi,

Here is an example where the constraint is added for the parameter 1, slope of the exponential

Lorenzo[propagateSystematicErrors.C](https://root-forum.cern.ch/uploads/default/original/2X/4/4855b3953a503109d86f5d9d847577319f01f8ce.C) (2.4 KB)

---

<div class="post-metadata">

**Author:** ![atd](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atd/32/33835_2.png) [@atd](https://root-forum.cern.ch/u/atd)\
**Post date:** [March 2, 2017, 3:32pm UTC](https://root-forum.cern.ch/t/root-fit-parameter-error-propagation/23778/5 "2017-03-02T15:32:38Z")

</div>

Hello

Thank you for your example code.

The final error is smaller using this way, compared to the “Montecarlo way”.

I will need more time to understand the statistics that is causing this issue (do you have any suggestion?).

Thank you again for your time.

Best regards,  
Alvaro.
