# Something quite strange with the linear fit

**URL:** <https://root-forum.cern.ch/t/something-quite-strange-with-the-linear-fit/54758>\
**Category:** Newbie\
**Tags:** root\
**Created:** [May 5, 2023, 9:32pm UTC](https://root-forum.cern.ch/t/something-quite-strange-with-the-linear-fit/54758 "2023-05-05T21:32:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrapo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/da6949/32.png) [@rrapo](https://root-forum.cern.ch/u/rrapo)\
**Post date:** [May 5, 2023, 9:32pm UTC](https://root-forum.cern.ch/t/something-quite-strange-with-the-linear-fit/54758/1 "2023-05-05T21:32:39Z")

</div>

Hi!  
I don’t know exactly what kind of problem I have.  
let me explain: I wrote this code to fit the data written in the .c file down attached and the fit works (because the error bars are big, but this is not a problem because these measures are definitely ok).

But I started becoming suspicious about the error on the parameter p0 (the value is -1 plus-minus 24).  
I tried to fit these data in Origin and it gave similar values of p0 and p1, but the errors on all the parameters were 0.1 times the one root calculated .

do you think there is something wrong with the code?

how the same data fitted by two different program gave two different errors ?

I hope you can somehow help me. I am sorry for the trouble  
have a nice day,  
Rrapo

[strangefit.c](https://root-forum.cern.ch/uploads/short-url/79QRWNLXWDcElKvtqPWhntZ2h8T.c) (2.5 KB)

---

<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:** [May 6, 2023, 8:44am UTC](https://root-forum.cern.ch/t/something-quite-strange-with-the-linear-fit/54758/2 "2023-05-06T08:44:14Z")

</div>

Your “`err_lambda`” values are pretty big, resulting in “big” errors of the fitted parameters.  
Your “`err_numeri`” values are not significant here.

I suspect that the “Origin” fit does not consider your “`err_*`” errors.
