Dear rooters:
I am trying to generate a bunch of negative binomial distribution with TF1 using “r” and “p” parameters that I have extracted from a set of data. From the data I extract a mean and a variance term that I use to calculate “r” and “p” and construct the functions. I just took one example where I have a mean of 1.63 from where I infer an r =18.9242 and a p=0.920519. Now the problem is that I create the TF1 using ROOT::Math::negative_binomial_pdf(x[0],0.920519,18.9242)
and when I plot this function I get a mean of 2.13252 (from Mean(min,max)
) and the function looks like shifted to the right (it never reaches x=0). I have cross-checked my calculation of the mean using std::negative_binomial_distribution<int> d(round(18.9242),0.920519)
and the result is correct (1.63774). I am not sure what I am doing wrong. I attach a simple macro that illustrates the problem.
Thank you very much in advance
F.
test_NBD.C (2.0 KB)
Please provide the following information:
ROOT Version 6.06/06):
Platform, compiler (Ubuntu 16 gcc and Mac El Capitan):