I want to construct and 1D plot a uni-variate Gaussian Mixture with say three components in Python where I already have its parameters including mu,sigma,mix coefficients.
What I am after has an equivalent in MATLAB i.e. gmdistribution(mu,sigma,p)
I think the code should look sth like this:
from numpy import *
from matplotlib.pylab import *
from sklearn import mixture
gmm = mixture.GMM(n_components=3)
gmm.means_ = np.array([[-1], [0], [3]])
gmm.covars_ = np.array([[1.5], [1], [0.5]]) ** 2
gmm.weights_ = np.array([0.3, 0.5, 0.2])
fig = plt.figure(figsize=(5, 1.7))
ax = fig.add_subplot(131)
#ax.plot(gmm, '-k')
Wondering how to do it...
Cheers