'Residuals indicating which observations are misclassified.
Notes
The residuals for the multinomial model are defined as
.. math:: argmax(y_i) \neq argmax(p_i)
where :math:`argmax(y_i)` is the index of the category for the
endogenous variable and :math:`argmax(p_i)` is the index of the
predicted probabilities for each category. That is, the residual
is a binary indicator that is 0 if the category with the highest
predicted probability is the same as that of the observed variable
and 1 otherwise.'

@cache_readonly
def resid_misclassified(self):

    return (self.model.wendog.argmax(1) != self.predict().argmax(1)).astype(float)
