Question from Michael Baron's Probability and Statistics for Computer Scientists, 2nd edition:
Data: 3 7 5 3 2. Assume data is produced from Geometric distribution. Estimate $p$, the geometric distribution parameter. (Geometric distribution: $P(x) = (1-p)^{x-1}p$, $x=1,2,...$)
My solution, using method of maximum likelihood: Find $M = \sum_{i=1}^5 \ln(P(x_i))$. Then solve for $\frac{dM}{dp}=0$.
- $M = \sum_{i=1}^5 \ln((1-p)^{x_i - 1}p)=15\ln(1-p)+ 5\ln p$
- $\frac{dM}{dp}=0=\frac{15}{1-p}+\frac{5}{p} \to p=-\frac{1}{2}$
This is obviously wrong, as $p$ is a probability. I did this twice, what am I doing wrong?