'Returns the J x J prediction table.
Notes
pred_table[i,j] refers to the number of times "i" was observed and
the model predicted "j". Correct predictions are along the diagonal.'

def pred_table(self):

    ju = (self.model.J - 1)
    bins = np.concatenate(([0], np.linspace(0.5, (ju - 0.5), ju), [ju]))
    return np.histogram2d(self.model.endog, self.predict().argmax(1), bins=bins)[0]
