2
$\begingroup$

The deviance residual for binomial regression has the form $sign(y_i- m_i\hat{p}_i)d_i$, where $m_i\hat{p}_i$ is the fitted value, $d_i$ is the contribution of observation i to the deviance of the model fitted. I am having some troubles deriving the form of $d_i$. As shown below, I could not obtain the coefficient for the 2nd log term to be $m_i-y_i$. Could anyone show me where I made mistakes? Thanks in advance!

The form given in my lecture notes: enter image description here

My attempt of derivation: enter image description here


As mentioned by Thomas, the natural parameter $\theta_i$ = logit($\mu_i$) instead. The correct derivation: enter image description here

$\endgroup$
2
$\begingroup$

First thing to check: who's wrong?

Your version breaks down if $y_i=m_i$ but $\hat p_i\neq 1$, giving $m_i\log 0=-\infty$ for the second term and no rescue from the first term, which stays finite. The version in your notes is ok if you define $x\log x$ at $x=0$ by the limit from above.

Tracing that back, infinities first appear at your second bullet point.

Even before that, though, you've taken the parameter to be $\log \mu$ and it's actually $\mathrm{logit} \mu$ (assuming you're using the canonical logit link, which matches the formula in your lecture notes).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.