def sample(self, size, random_state=None):
    'Generate random samples from the model.\n        Returns\n        -------\n        X : array_like, shape (n_samples, n_features)\n            List of samples\n        '
    if (random_state is None):
        random_state = numpy.random
    mins = self.lims[:, 0]
    maxes = self.lims[:, 1]
    X = numpy.empty(size, ('f8', (self.means.shape[1],)))
    comps = random_state.choice(len(self.weights), p=self.weights, size=size)
    for comp in range(len(self.weights)):
        comp_in_X = (comp == comps)
        num_comp_in_X = comp_in_X.sum()
        if (num_comp_in_X > 0):
            cv = self.covs[comp]
            g = sample_gaussian2(self.means[comp], cv, num_comp_in_X, random_state, mins, maxes).T
            X[comp_in_X] = g
    return X
Generate random samples from the model.
Returns
-------
X : array_like, shape (n_samples, n_features)
    List of samples
def sample(self, size, random_state=None):
    'Generate random samples from the model.\n        Returns\n        -------\n        X : array_like, shape (n_samples, n_features)\n            List of samples\n        '
    if (random_state is None):
        random_state = numpy.random
    mins = self.lims[:, 0]
    maxes = self.lims[:, 1]
    X = numpy.empty(size, ('f8', (self.means.shape[1],)))
    comps = random_state.choice(len(self.weights), p=self.weights, size=size)
    for comp in range(len(self.weights)):
        comp_in_X = (comp == comps)
        num_comp_in_X = comp_in_X.sum()
        if (num_comp_in_X > 0):
            cv = self.covs[comp]
            g = sample_gaussian2(self.means[comp], cv, num_comp_in_X, random_state, mins, maxes).T
            X[comp_in_X] = g
    return X