def generate_nb_state_data(means, weights, R):
cells = weights.shape[<NUM_LIT:1>]<EOL>x_true = np.dot(means, weights)<EOL>R_ = np.tile(R, (cells, <NUM_LIT:1>)).T<EOL>P_true = x_true/(R_ + x_true)<EOL>sample = np.random.negative_binomial(np.tile(R, (cells, <NUM_LIT:1>)).T, P_true)<EOL>return sample.astype(float)<EOL>
Generates data according to the Negative Binomial Convex Mixture Model.

Args:
    means (array): Cell types- genes x clusters
    weights (array): Cell cluster assignments- clusters x cells
    R (array): dispersion parameter - 1 x genes

Returns:
    data matrix - genes x cells