def sample(self, z, x, i,n):
        x_mean = np.dot(self.C, z[i,n,:])
        x_pi = np.exp(x_mean)
        x_pi /= np.sum(x_pi)


        from pybasicbayes.util.stats import sample_discrete
        s = sample_discrete(x_pi)
        x[i,:] = 0
        x[i,s] = 1
Sample the next state given the previous time index
dataset/ETHPy150Open HIPS/pgmult/pgmult/particle_lds.py/_CategoricalLikelihood.sample