# Poisson distribution for a given mean

**URL:** <https://root-forum.cern.ch/t/poisson-distribution-for-a-given-mean/33945>\
**Category:** Roofit and RooStats\
**Created:** [May 7, 2019, 4:10pm UTC](https://root-forum.cern.ch/t/poisson-distribution-for-a-given-mean/33945 "2019-05-07T16:10:55Z")\
**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:** [May 7, 2019, 6:21pm UTC](https://root-forum.cern.ch/t/poisson-distribution-for-a-given-mean/33945/2 "2019-05-07T18:21:58Z")

</div>

Some ideas:

> [@\[Solved\] Fit TH1D with Poisson Function](https://root-forum.cern.ch/t/solved-fit-th1d-with-poisson-function/29886/6):
>
> I think the problem is in the “x range” of your histogram. From your picture, I can see that “x\_max = 10.e-6” and the [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution) expects “x\_max \>= 1” (so, in principle you should also have “mean \>= 0.5”). You could try to “scale” your “x range”: { double xmin = 0.; double xmax = 10.e-6; TF1 \*f = new TF1("f", "[0] \* TMath::Poisson((x/[2]), ([1]/[2]))", xmin, xmax); double constant = 160.; double mean = 1.5e-6; double xscaling = 2.e-7; f-\>SetParameters(constant, mean, xsc…

> [@Fitting a Poisson Distribution to a histogram](https://root-forum.cern.ch/t/fitting-a-poisson-distribution-to-a-histogram/12078/7):
>
> I guess, the trick with the parameter “[2]” is to scale “x” and then also “u” (as they appear in your “definition”), so that the “mean” (and thus also the “variance”) remains simply the value of the parameter “[1]”. You could try to “scale” the “x-axis” of your histogram by the value of the parameter “[2]” (then also possibly “f1-\>FixParameter(2, 1.0);”) and then redo your fit: { gStyle-\>SetOptFit(112); Double\_t xmin = 0, xmax = 10; // define the Poisson fit function TF1 \*f = new TF1("…

---

_[View the full topic](https://root-forum.cern.ch/t/poisson-distribution-for-a-given-mean/33945)._
