# Excluding a point from a fit

**URL:** <https://root-forum.cern.ch/t/excluding-a-point-from-a-fit/1513>\
**Category:** ROOT\
**Created:** [February 7, 2005, 6:08pm UTC](https://root-forum.cern.ch/t/excluding-a-point-from-a-fit/1513 "2005-02-07T18:08:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahamil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/9de053/32.png) [@ahamil](https://root-forum.cern.ch/u/ahamil)\
**Post date:** [February 7, 2005, 6:08pm UTC](https://root-forum.cern.ch/t/excluding-a-point-from-a-fit/1513/1 "2005-02-07T18:08:28Z")

</div>

Hello,

Is it possible to exclude a point from a fit? I’m just making a linear fit to ~10 data points, just with the simple pol1 function:

hist-\>Fit(“pol1”,"","",fit\_min,fit\_max);

In some of my histograms I have bad data points that I would like to exclude from the fit.

Thanks for any help,  
Cheers,  
Andrew

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [February 7, 2005, 10:32pm UTC](https://root-forum.cern.ch/t/excluding-a-point-from-a-fit/1513/2 "2005-02-07T22:32:48Z")

</div>

Only bins with a non-null error are taken into account in a fit.  
Call TH1::SetBinError(bin,0); for the bins you want to exclude.  
You can also excluse a range via TF1::RejectPoint  
[root.cern.ch/root/htmldoc/TF1.ht … ejectPoint](http://root.cern.ch/root/htmldoc/TF1.html#TF1:RejectPoint)

see an example in tutorial fitExclude.C

Rene
