How this calculation works
A Gaussian mixture represents a sample with several weighted normal components. This calculator runs five seeded EM starts, retains the best converged local likelihood and reports components sorted by mean. A scale-relative variance floor prevents a component from collapsing to a zero-width spike with an unbounded likelihood.
f(x)=Σ_k pi_k N(x|mu_k,sigma_k²); EM alternates responsibilities and weighted moments.A worked example
For the six prefilled values −2,−1,0,0,1,2 and one component, the fitted mean is zero and population variance is 10/6=5/3. The log likelihood is −3[log(2pi×5/3)+1]. With more components, fitting becomes nonconvex and the best seeded run need not be globally optimal.
Good to know
Univariate Gaussian mixtures, one to four components, 6–300 observations and a fixed seed. Variance floor is 10^−6 times sample population variance. Collapsed/unconverged starts may fail. No automatic component count, global optimum or cluster-truth assertion.
Reference: Scikit-learn Gaussian mixtures (opens in a new tab) ↗
Responsibilities are soft component memberships
For each sample value, EM assigns a probability-like responsibility to every component under the current mixture. Those responsibilities sum to one and weight the next parameter updates. A point can belong partly to several components, so assigning it permanently to the largest responsibility would define a separate hard-clustering procedure.
Component labels are interchangeable. Sorting the final components by mean makes the table reproducible and easier to compare, but it does not change the mixture density. When components overlap heavily, their separate parameter values can be weakly determined even if the combined density and likelihood are relatively stable across starts.
The Mean median mode variance and standard deviation calculator covers the nearby task. Mixture estimation separates latent components and likelihood; descriptive summaries do not fit such a model.
Variance regularization changes the likelihood problem
An unconstrained Gaussian mixture likelihood can increase without bound when a component collapses onto one observation. The declared variance floor prevents that singularity. It is part of the fitted model, not just a formatting adjustment; changing the floor can change the optimum and should be recorded when results are compared.
Data are internally centered and scaled before optimization, and the floor is mapped back to original squared-coordinate units afterward. The displayed mean and variance therefore use the original sample scale. A zero-variance sample is rejected because that rescaling and a meaningful scale-relative variance floor would otherwise be undefined.
Seeded convergence does not prove a unique clustering
Five seeded starts provide alternative initial component positions. Only a converged run can be selected, and the best retained likelihood remains a local fit. Increasing the component count often improves training likelihood even when it overfits, so the page does not declare that the requested count is supported simply because EM converged.
The one-component default has analytic maximum-likelihood mean and population variance, providing an independent objective check. Multicomponent tests additionally inspect likelihood monotonicity, normalized weights and reconstructed density values. No automatic information-criterion selection, confidence interval or statement that components correspond to real biological, social or causal groups is inferred.
Follow the E and M steps of the mixture fit
A k-component Gaussian mixture has density Σπj φ(x;μj,σj²), with positive weights adding to one. In the E step, each observation receives a responsibility proportional to πj times that component’s density. In the M step, weights, means and variances are recomputed using those fractional memberships. The process repeats while checking the likelihood.
Responsibilities describe uncertainty under the fitted density rather than a mandatory hard assignment to a true population. This implementation sorts observations internally and presents component parameters in a consistent order. A component’s label can otherwise swap with another component without changing the density, so compare sorted parameters or the overall density when reproducing a fit.
Use the one-component fit as a hand-checkable baseline
For observations −2,−1,0,0,1,2, one component has mean zero and maximum-likelihood variance (4+1+0+0+1+4)/6=5/3. Its log likelihood is −n[log(2πσ²)+1]/2≈−10.046108. The weight is one because there is no second component to share probability mass.
Shift every value by ten: the fitted mean becomes ten and variance remains 5/3. Multiplying all observations by two instead multiplies the mean by two and the variance by four. Density values and log likelihood then change with the measurement scale, so raw likelihoods in different units should not be compared as if they referred to the same numeric data.
Understand why several starting points are necessary
For k>1, mixture likelihood is not a convex objective in all parameters. EM can converge to different local solutions from different initial means. The seed makes the five-start search repeatable; it does not guarantee a global maximum. Trying another seed is a sensitivity check, and substantially different fitted densities are a reason to question stability.
Unrestricted Gaussian mixture likelihood can grow without bound when one component variance collapses around an observation. This calculator imposes a variance floor of 10^−6 times the sample population variance and rejects unusable starts. A returned very small variance should therefore be inspected as a boundary-sensitive modeling outcome, not celebrated as a perfectly identified narrow subpopulation.
Choose components for the density question you actually have
Increasing k typically gives more flexibility but can split skewness or a heavy tail into several Gaussian components. Several fitted components therefore need not mean several real groups. Conversely, one component can underrepresent a genuinely multimodal distribution. The selector leaves k to you; it does not compute BIC, perform cross-validation or infer a scientifically correct component count.
Check sensitivity to outliers, rounding, repeated measurements and seed before interpreting component parameters. The six-observation default is an arithmetic illustration, not a recommended sample size for discovering clusters. Do not compare log likelihoods from different observation sets or claim calibrated classification probabilities outside the fitted mixture model.
A few questions, answered
Does the best start prove a global optimum?
No. Five starts improve exploration but retain only a best converged local likelihood.
Why impose a variance floor?
Without one, a Gaussian component can collapse on a sample and make likelihood singular.
Does the seed guarantee the best possible mixture?
No. It repeats a bounded five-start EM search. Different seeds can expose alternative local optima, especially with overlapping components.
Does each component represent a real population?
Not necessarily. Multiple Gaussians can approximate one skewed or heavy-tailed population. That interpretation requires evidence beyond the fitted density.