Maximum likelihood geometric distribution

1k Views Asked by At

This one i'm stuck on because I am not sure where the relative frequencies fit in:

The following data show the number of occupants in passenger cars observed during one hour at a busy intersection in Los Angeles. Suppose it can be assumed that these data follow a geometric distribution $p_X(k;\theta)=(1-p)^{k-1}p$, $k=1, 2,3,...$ Estimate $p$ and compare the observed and expected frequencies for each value of X.

\begin{array}{|c|c|} \hline \text{Number of Occupants}& \text{Frequency} \\ \hline 1& 678\\ \hline 2& 227\\ \hline 3& 56\\ \hline 4& 28\\ \hline 5& 8\\ \hline 6+& 14\\ \hline & 1011\\ \hline \end{array}

$$L(p) = \prod_\limits{i=1}^{n}(1-p)^{k_i-1}p \\ = (1-p)^{\sum_\limits{i=1}^{n}(k_i-1)}p \\ \ln(L(p)) = \sum_\limits{i=1}^{n}(k_i-1)\ln(1-p)+\ln(p)$$

However, I'm not totally sure I'm heading down the right path here .... A gentle nudge would be appreciated.

OK, continuing on from where @AhmadBazzi got me to...

\begin{equation} \frac{n - \sum k_i}{1-\hat{p}} + \frac{1}{\hat{p}} = 0 \end{equation}

$$\frac{p-1}{p} = (n-\sum k_i) \\ \frac{p}{p} - \frac{1}{p} = n-\sum k_i \\ 1 - n + \sum k_i = \frac{1}{p} \\ p = \frac{1}{1 - n + \sum k_i}$$

Is this correct? If it is, this is another part I'm not sure about. n = 1011 I believe and $\sum k_i = 1 + 2 + 3 + 4 + 5 + ^ + ..$ This is what I'm not sure about. I'm not sure if I have my variables correctly allocated and how to related it to the frequency table....

1

There are 1 best solutions below

2
On BEST ANSWER

NOTE: This answer was posted before OP edited the question and added the steps that I proposed.

Yes you're on the right track. You've got $\ln L(p)$ which is the log-likelihood function. Now, using simple calculus, you need to find $\hat{p}$ that maximizes $\ln L(p)$.

Just to organize your function, use \begin{equation} \sum_{i=1}^n ( k_i - 1 ) = \sum_{i=1}^n k_i - \sum_{i=1}^n 1 = \sum_{i=1}^n k_i - n \end{equation}

\begin{equation} \ln L(p) = (\sum k_i - n) \ln(1-p) + \ln (p) \end{equation} The first order condition is \begin{equation} \frac{\partial }{\partial p} \ln L(\hat{p}) = 0 \end{equation} i.e. \begin{equation} \frac{n - \sum k_i}{1-\hat{p}} + \frac{1}{\hat{p}} = 0 \end{equation} Now find $\hat{p}$.