= Solution
Independence gives the <log-likelihood>
$$
\ell(\beta)=\sum_i\left[y_i\beta^Tx_i-\log(1+e^{\beta^Tx_i})\right].
$$
Differentiating yields the <score equations>
$$
\boxed{\sum_i x_i\bigl[y_i-p_i(\hat\beta)\bigr]=0.}
$$
When a finite <maximum-likelihood estimator> exists, multiplying these equations by $\hat\beta^T$ gives
$$
\sum_i y_i\operatorname{logit}p_i(\hat\beta)=\sum_i p_i(\hat\beta)\operatorname{logit}p_i(\hat\beta).
$$
The qualification about a finite estimator matters under <complete separation> in <logistic regression>, where coefficient estimates can escape to infinity.
Back to article page