def generate_zip_state_data(means, weights, z):
    """
    Generates data according to the Zero-inflated Poisson Convex Mixture Model.

    Args:
        means (array): Cell types- genes x clusters
        weights (array): Cell cluster assignments- clusters x cells
        z (float): zero-inflation parameter

    Returns:
        data matrix - genes x cells
    """
    x_true = np.dot(means, weights)
    sample = np.random.poisson(x_true)
    random = np.random.random(x_true.shape)
    x_true[random < z] = 0
    return sample.astype(float)