MLE estimator for $f(y|p)=p^y(1-p)^{1-y}$.

163 Views Asked by At

Consider the density function $f(y|p)=p^y(1-p)^{1-y}$ where $y\in \{0,1\}$. Given a random sample $Y_1,Y_2,...,Y_n$, I want to find the maximum likelihood estimator for $p$. The likelihood is given by $$ L(y|p)=(p^y(1-p)^{1-y})^n $$ Usually to find the maximum likelihood I would set the derivative equal to zero, however, the derivative of $L(y|p)$ evaluated at zero is indeterminate. So how do I find it when I cannot use the derivative?

Edit: as has been pointed out, the above is not the correct likelihood. The correct should be $$ \begin{equation} L(y \mid p)=\prod_{i=1}^n p^{y_i}(1-p)^{1-y_i} \end{equation} $$

1

There are 1 best solutions below

0
On BEST ANSWER

You can take the log of $L$ first, and then use the first order condition to identify the best value for $p$. The reason this will work is that the log is a strictly increasing function, so the maximizer of L will be the same as the maximizer of log L.

$$ \begin{aligned} \log L &= \sum_{i=1}^n \log(p^{y_i}(1-p)^{1-y_i}) \\ &= \sum_{i=1}^n y_i\log p + (1-y_i) \log (1-p) \end{aligned} $$

Then $$ \begin{aligned} \frac{d}{dp}\log L &= \sum_{i=1}^n \frac{y_i}{p} - \sum_{i=1}^n\frac{1-y_i}{1-p} \\ &= \frac{1}{p}\sum_{i=1}^n y_i - \frac{1}{1-p}\left(n-\sum_{i=1}^n y_i\right) \end{aligned} $$

If we let $\bar y = \sum_{i=1}^n y_i$, then just a little bit of algebra shows that $\frac{d}{dp}\log L = 0$ iff $p = \bar y$.