How can $\frac{x}{\pi}-\frac{n-x}{1-\pi}$ be the correct derivative of $x\log\pi+(n-x)\log(1-\pi)$?

152 Views Asked by At

I am learning statistics and come across this calculation for Maximum-Likelihood estimator for the Binomial distribution. I don't understand the step from second to third row where they took the derivative,

calculation

my attempt gave me only $\log \left(π\right)$ as result. this is my calculation: $$\left(x \log \left(π\right)+\left(n-x\right)\log \left(1-π\right)\right)' = \\ = x'\log \left(π\right)+x\log \left(π\right)' + \left(n-x\right)'\log \left(1-π\right)+\left(n-x\right)\log \left(1-π\right)' = \\ \log \left(π\right) + 0 + 0 + 0 = \log \left(π\right)$$

Am I doing this wrong?

2

There are 2 best solutions below

13
On BEST ANSWER

Note that in this case, $\pi$ is the variable, not $x$

0
On

The derivative was done with respect to $\pi$ (a wrong choice of the parameter, indeed, as $\pi$ is a standard constant--a well known real number). Write $p$ instead of $\pi$ and differentiate with respect to $p$ to get the result.