'Inverse of the multinomial logit transform, which gives the
expected values of the data as a function of the linear
predictors.
Parameters
lpr : array-like (length must be divisible by `ncut`)
The linear predictors
Returns
prob : array
Probabilities, or expected values'

def inverse(self, lpr):

    expval = np.exp(lpr)
    denom = (1 + np.reshape(expval, ((len(expval) // self.ncut), self.ncut)).sum(1))
    denom = np.kron(denom, np.ones(self.ncut, dtype=np.float64))
    prob = (expval / denom)
    return prob
