What is the MLE of Bernoulli distribution? or how do you derive it?

361 Views Asked by At

Derive the MLE for Bernoulli distribution? Just need help studying for a test tomorrow and this is a question on the practice exam. I think I will get a question on this just with a different distribution so can someone help me?

1

There are 1 best solutions below

1
On BEST ANSWER

Let $X_{1},...,X_{n}$ be independent and identically distributed variables of Bernoulli distribution with probability p. (i.e. $\sum_{i=1}^{n} X_{i}$ is Binomial distribution with size n and probability p)

So the pdf is $f(x|p)=p^x(1-p)^{(1-x)}$

  • Find the likelihood function: $L(X|P)=\prod_{i=1}^{n} f(x_{i}|p)=\prod_{i=1}^{n} p^{x_{i}}(1-p)^{(1-x_{i})}=p^{\sum_{i=1}^{n} x_{i}}(1-p)^{n-\sum_{i=1}^{n} x_{i}}$
  • Find log likelihood for p:$l(X|P)=ln(L(X|P))=ln(p^{\sum_{i=1}^{n} x_{i}})+ln((1-p)^{n-\sum_{i=1}^{n} x_{i}})=(\sum_{i=1}^{n} x_{i})ln(p)+(n-\sum_{i=1}^{n} x_{i})ln(1-p)$
  • Take the derivative with respect to p: $\frac{dl}{dp}=\frac{\sum_{i=1}^{n} x_{i}}{p}-\frac{n-\sum_{i=1}^{n} x_{i}}{1-p}$
  • Set the derivative to zero: $\frac{dl}{dp}=\frac{\sum_{i=1}^{n} x_{i}}{p}-\frac{n-\sum_{i=1}^{n} x_{i}}{1-p} = 0$
  • Solve for p: $P_{MLE}=\frac{\sum_{i=1}^{n} x_{i}}{n}$