Choose six illustrative values , fixed mixture weights , known standard deviation , and initial means . These are constructed data for a Gaussian mixture distribution, not measurements. With the standard normal distribution probability density function, the fitted log-likelihood is
At the initial means, the component density ratio is . The first E-step therefore gives
Figure 1.
The first E-step retains two soft label probabilities at each chosen data point
. Initial means are minus one and one, mixture weights are one half, and the known standard deviation is one. Stacked bars show the two conditional label probabilities; every row sums to one. Small but nonzero probabilities remain visible in the numerical labels. Details.
The paired values and have complementary mixture responsibilities, so exactly. The first M-step gives
The hyperbolic tangent expression follows by pairing the contributions at and . Assigning every negative value wholly to the first mixture component and every positive value wholly to the second would instead give means . Those hard assignments discard the overlap: the expectation-maximization algorithm is not the same update as K-means clustering.
The observed-data log-likelihood rises from initially to after one update and after two. Further updates approach means , with log-likelihood approximately . These values describe this initialization; EM likelihood monotonicity supplies no certificate of a global maximum.
Figure 2.
Likelihood ascent and mean updates for the chosen data, compared with an identical-means initialization
. Iteration zero is the initial fit; each subsequent point follows one E-step and one M-step. Starting at minus one and one increases the likelihood. Starting both means at zero leaves them at zero with a lower constant likelihood. All runs keep variance one and weights one half. Details.
For stable numerical evaluation, put and . The log-sum-exp function gives
Subtracting keeps at least one exponential equal to one, avoiding the all-zero sum that direct evaluation of tiny component densities can produce.
The posterior kernel gives two gamma full conditional distributions directly:
with rates as the second parameters. For the index, terms independent of the proposed value cancel. Its conditional weights are
Define and . The normalized categorical probabilities are
Subtracting the largest log weight prevents needless numerical overflow, an application of the log-sum-exp function.
Precompute the cumulative counts . Initialize any and positive rates. At each iteration, draw from its gamma conditional given the current index, draw from its gamma conditional given that index, and draw a new index from the categorical probabilities using the newly drawn rates. Repeat and retain the parameter triples after initialization effects have diminished. These are the Gibbs updates for a Poisson count change point.
To verify invariance rather than just identify a sampler, a coordinate update integrates the old joint density as and replaces the first factor by an independent draw from the same conditional. The joint posterior distribution is therefore unchanged. The same argument applies to the other two updates, so their composition preserves the posterior. All gamma densities and all categorical weights are positive on their supports. The full-sweep transition density is consequently positive across the joint support, giving the usual irreducibility and aperiodicity conditions for this proper-posterior Gibbs sampler. This supports posterior long-run averages under the ergodic theorem for a positive Harris recurrent Markov chain.
Introduce a categorical latent variable for each observation, with , and let . Conditional on , has a normal distribution of mean and the shared variance . The complete-data log-likelihood function is
Initialize finite means, positive weights summing to one, and a positive common variance. At iteration , the Bayes' theorem gives the E-step mixture responsibilities
The common normal-density factor cancels. The observations' conditional labels are independent, and replacing by their conditional expectations gives
Set ; because , . The constrained weight maximization uses a Lagrange multiplier : differentiating gives , and summing fixes . Differentiating the residual quadratic in each mean gives . Hence the first two M-step updates are
With these new means define . The remaining objective in is , whose derivative is . For it increases up to and decreases afterwards. Thus the shared-variance update is
The denominator is , not and not a separate count for each component: this is maximum likelihood estimation with one common variance. These are the EM for Gaussian mixtures with a common variance updates. Recompute responsibilities with the new parameters and repeat until the observed-data likelihood changes sufficiently little.
The monotonicity claim also follows directly. For positive old weights, the likelihood ratio for observation is
Apply the Jensen inequality to the logarithm and sum over observations. This yields
for the maximizing M step. This proves likelihood increase, not convergence to the global maximum. Use several initializations to reduce sensitivity to local maxima. Compute responsibilities with a log-sum-exp function normalization to avoid numerical underflow.
If , that component's updated weight is zero and its mean is unidentified; retain its old mean or remove the empty component. Strictly positive interior initialization avoids this case in exact arithmetic while the variance stays positive. If , there is no positive finite variance maximizing this M step: the objective tends to infinity as . Such boundary degeneracy needs a variance constraint or regularization, as discussed in the next solution. For the formulas reduce to the ordinary sample mean and the maximum-likelihood variance .
Write . The log-sum-exp function is convex and composition with the affine functions preserves convexity, so is convex. Directly, its Hessian matrix will also be shown positive semidefinite in part d.
Let . Factoring out of the sum gives
At least one term in the sum is , while every term is at most . Therefore
and hence
Thus is a uniform smooth maximum of the affine pieces of .
The substitution , with , is a bijection onto and obeys
Thus the log-sum-exp function transfers nonnegative addition to the given set. It is closed, associative and commutative, with identity element . But a finite has , and adding a nonnegative number cannot give zero, so no finite has an inverse element. Therefore it is a commutative monoid but not a group.
Smooth maximum 2026-09-28
Composing the log-sum-exp function with finitely many affine functions gives a differentiable approximation to their pointwise maximum. Increasing the inverse-temperature parameter reduces the uniform approximation error while increasing the Lipschitz gradient constant.