# Score function of poisson distribution

When counting the score for poisson distribution I get the log likelihood

$$S(\mu ) = \frac{\partial \ell(\lambda )}{\partial \lambda } = \sum_1^n \left(\frac{y_i}{\lambda}-1\right)$$

Textbook says that it is equivalent to: $$\frac{n(\overline{y}-\lambda)}{\lambda}$$

I can get easily solve the fisher score from there on, but I'm not quite sure about this equation. Why does it switch to the mean of y? If you take the $$1/{\lambda}$$ on the front of the sum, wouldn't it then be $$S(\mu ) = \frac{\partial \ell(\lambda )}{\partial \lambda } = \left(\frac 1 \lambda \right) \sum_1^n (y_i-1) \text{ ?}$$

• Two Greek letters appear here: $\mu$ and $\lambda$. Is that a typo? Did you mean $S(\lambda)$ rather than $S(\mu)\text{?} \qquad$ – Michael Hardy May 7 '19 at 17:27

$$\begin{eqnarray} \sum_{i=1}^n \left( y_i / \lambda - 1 \right) &=& \sum_{i=1}^n \left( (y_i - \lambda) / \lambda \right) \\ &=& \left( \left(\sum _{i=1}^ny_i - n \lambda \right) / \lambda \right) \\ &=& n \left( \left(\bar{y} - \lambda \right) / \lambda \right) \\ \end{eqnarray}$$
\begin{align} & \sum_{i=1}^n \left( \frac {y_i} \lambda -1\right) = \sum_{i=1}^n \frac {y_i-\lambda} \lambda \\[10pt] = {} & \frac{y_1-\lambda}\lambda + \cdots + \frac{y_n-\lambda} \lambda \\[10pt] = {} & \frac{(y_1 + \cdots + y_n) - n\lambda} \lambda = \frac{n\overline y - n\lambda} \lambda. \end{align}
• I still don't understand why does the $$({y_1} +...+{y_n})$$ switch to the mean? Isn't $$({y_1} +{y_2} + {y_3} + ...+{y_n})$$ just the sum of y's over 1 to n? – Guest192 May 7 '19 at 19:56
• @Guest192 : The sum did not switch to $\overline y,$ but rather to $n\overline y.$ The sum is $n$ times the mean. $\qquad$ – Michael Hardy May 8 '19 at 16:46