def __init__(self, means=0, sigmas=1, weights=1):
data = np.array([t for t in np.broadcast(means, sigmas, weights)])
precisions = [1/s**2 for s in sigmas]
self._gmm = GaussianMixture(data.shape[0],
weights_init=data[:, 2] / data[:, 2].sum(),
means_init=data[:, :1],
covariance_type="spherical",
precisions_init=precisions)
self._gmm.fit(data[:, :1]) // GaussianMixture requires "fit" be called once
self._gmm.fit = None // disable fit method for safety
def sample(self, size):