I am trying to fit a gaussian mixture model to a one dimension array in python. I am using "mixture" from Sklearn library in Python.
My sample array includes 437 samples from a single normal distribution with mean = 70.2 and variance = 11.8 and I added some noise to it without losing the normal shape.
in Python my array, namely v, is like: v = array([ 87.37658674, 80.46544429, .... ,80.8180536])
I am using the mixture of gaussian function as follow to fit the sample set.
g=mixture.GaussianMixture(n_components=1) g.fit(np.array(np.split(v,v.shape[0])))
for your reference, the shape of "np.array(np.split(v,v.shape[0]))" is: (437, 1)
meaning I have 437 examples and one dimension.
after fitting the mean gets the correct value but the variance is way larger than sample variances (it gets 139.61 while the true variance should be around 11.8).
Does anyone know what am I doing wrong?