'Returns a random sample from the discrete distribution.
A vector is returned containing a single draw from each row of
`xk`, using the probabilities of the corresponding row of `pk`'

def rvs(self):

    n = self.xk.shape[0]
    u = np.random.uniform(size=n)
    ix = (self.cpk < u[:, None]).sum(1)
    ii = np.arange(n, dtype=np.int32)
    return self.xk[(ii, ix)]
