BRAGA

02 Writing02-02 Notes02-02-439

M-Step (Covariance Update)

Published 16 Apr 20263 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
Σknew=1Nk∑i=1nrik(xi−μknew)(xi−μknew)⊤\Sigma_k^{\text{new}} = \frac{1}{N_k} \sum_{i=1}^{n} r_{ik}(x_i - \mu_k^{\text{new}})(x_i - \mu_k^{\text{new}})^\top
(1)

We are working on the covariance update in the M-step of the EM algorithm for Gaussian Mixture Models. The canonical formula is

Σknew=1Nk∑i=1nrik(xi−μknew)(xi−μknew)⊤,\Sigma_k^{\text{new}} = \frac{1}{N_k} \sum_{i=1}^{n} r_{ik}(x_i - \mu_k^{\text{new}})(x_i - \mu_k^{\text{new}})^\top,
(2)

where Nk=∑i=1nrikN_k = \sum_{i=1}^{n} r_{ik} is the effective component size and rikr_{ik} are the responsibilities. This update gives the soft, responsibility-weighted covariance matrix for component kk under a standard full-covariance GMM.

Deep Breakdown

In a Gaussian Mixture Model, each component kk has its own mean vector μk\mu_k, covariance matrix Σk\Sigma_k, and mixture weight πk\pi_k. During the EM algorithm, the E-step computes the responsibilities rikr_{ik}, which are soft assignments telling us how much observation xix_i belongs to component kk. Once we have those soft assignments, the M-step updates the parameters of each Gaussian component. The covariance update is the part that determines the shape, spread, and orientation of each cluster.

The update is:

Σknew=1Nk∑i=1nrik(xi−μknew)(xi−μknew)⊤\Sigma_k^{\text{new}} = \frac{1}{N_k} \sum_{i=1}^{n} r_{ik}(x_i - \mu_k^{\text{new}})(x_i - \mu_k^{\text{new}})^\top
(3)

Inputs:

  • observations x1,…,xnx_1, \dots, x_n,
  • responsibilities rikr_{ik},
  • updated mean μknew\mu_k^{\text{new}},
  • effective component size NkN_k.

Output:

  • updated covariance matrix Σknew\Sigma_k^{\text{new}} for component kk.

Why it matters in DA/DS:

  • it determines cluster shape, not just cluster center,
  • it lets one mixture component stretch more in one direction than another,
  • it controls elliptical geometry in multivariate data,
  • it affects responsibilities in the next E-step,
  • it is essential for anomaly scoring, segmentation, and density estimation.

In a one-dimensional Gaussian mixture, covariance reduces to variance, which tells us how wide the component is.

In multiple dimensions, covariance does more:

  • diagonal terms measure variance in each feature,
  • off-diagonal terms measure how features move together inside the component,
  • eigenstructure of Σk\Sigma_k determines the principal axes of the cluster ellipse or ellipsoid.

This update is the soft-clustering analogue of a sample covariance matrix. In an ordinary sample covariance, every point counts equally. In the GMM M-step, every point is weighted by its responsibility for component kk. So points that strongly belong to component kk contribute more, and points that weakly belong contribute less.

This object links directly to:

  • Effective Component Size, because NkN_k normalizes the weighted sum,
  • M-Step (Means Update), because the covariance is centered around μknew\mu_k^{\text{new}},
  • M-Step (Weights Update), because the same responsibilities govern all M-step parameter updates,
  • cluster geometry, because the covariance matrix defines each Gaussian component’s shape.

Flowchart

Start with datapoints x_iE-Stepcomputesresponsibilitiesr_ikComputeeffectivecomponent sizeN_k = Σ_i r_ikUpdatecomponentmean μ_k^newFor each point,computecentered vectorx_i - μ_k^newForm outerproduct (x_i -μ_k^new)(x_i -μ_k^new)^TWeight eachouter product byr_ikSum weightedouter productsover all iDivide by N_kObtaincovarianceupdate Σ_k^newUse Σ_k^new innext E-Stepdensityevaluation

#machine-learning#machine-learning-algorithms#expectation-maximisation-em-for-gmms

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close