-1

I saw this article on wikipedia https://en.wikipedia.org/wiki/Beta-binomial_distribution and there is even a small example for the math-dummies like me. However, there is something I am not getting which is how to estimate the second factorial moment. I've been fiddling with this a bit, but no matter what I try, I never get to 42.31. If someone could provide a line of code or a formula that computes this, that would be super helpful. For the ones that like python, here is the data:

import numpy as np
n = 12
x = np.array([3,24,104,286,670,1033,1343,1112,829,478,181,45,7])
c = np.array(range(n+1))

Thank you for your help!

  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 18 '23 at 16:07

1 Answers1

0

OK, took me a while, but it is simply that:

m1 = sum(x*c)/sum(x) 
m2 = sum(x*c**2)/sum(x)

My confusion was that we are not looking for factorial moments here.