The probability of given data with the Negative binomial distribution

data analysisnegative binomialprobabilityprobability distributionsstatistics

A university exercise Statistics Learning and data analysis.

This is the problem:

Given that $ X=x_1,x_2,x_3,x_4,x_5,x_6,x_7,x_8,x_9, x_{10} = \left(2,3,7,8,2,4,7,5,5,7\right) $

  1. What is the mean $ {\overline{x}} $ ?

Answer: ${\overline{x}}=\frac{\left(2+3+7+8+2+4+7+5+5+7\right)}{10}=5 $

  1. What is the probability of $ P\left(X\le\overline{x}\right) $? with help from $ x_1,x_2,x_3,x_4,x_5,x_6,x_7,x_8,x_9, x_{10}$ from a $ NegBin\left(2,\frac{1}{3}\right) $ ?

My answer (That is wrong would be): $$ P\left(X\le\overline{x}\right)=\sum_{i=0}^5\left(\frac{1}{3}\right)^{^2}\left(\frac{2}{3}\right)^i\binom{i+2-1}{i}=\sum_{i=0}^5\left(\frac{1}{3}\right)^{^2}\left(\frac{2}{3}\right)^i\binom{i+1}{i}=\sum_{i=0}^5\left(\frac{1}{3}\right)^{^2}\left(\frac{2}{3}\right)^{^i}\left(i+1\right)=0.73663 $$

In the answer they stated that they drew $ x_1,x_2,x_3,x_4,x_5,x_6,x_7,x_8,x_9, x_{10}$ 100 times and got the answer $ P\left(X\le5\right) = 0.19$

My questions are:

  1. How do you come to the same conclusion as the "right answer"?
  2. Is there a different way of solving this problem?
  3. How would you answer the problem (2)?

Thanks!

Update:

The data X are the number of times something is observed in a day. Meaning there are 10 days and therefore 10 observed data in X.

NegBin(r,p) = $$ NegBin(r,p): fx(x) = (p)^{r}(p-1)^i\binom{i+r-1}{i}, E[X] = r(1 − p)/p $$

Best Answer

To answer the question as the "real answer" you will have to:

  1. Make $100$ random variables between $0$ and $1$.
  2. Check for every number of $i$ in $\text{NegBin}(r,p)$, where $u > \text{NegBin}(r,p)$, and for every single $i$ that you check, you will add the previous PDF function $(i-1)$.
  3. Whenever $u < \,($sum of all $\text{NegBin}(r,p)$ for an $i)$, this $i$ will be saved as a simulation of $\text{NegBin}(r,p)$.
  4. Then you check $P(\text{simulations} \leq 5)$, and this will give you the answer.
Related Question