GMM uses Gaussian distributions to model clusters.
Gaussian Distribution in d Dimensions
For d dimensions, the Gaussian distribution of a vector x=(x1,x2,…,xd)T is defined by:
N(x∣u,Σ)=(2π)d/2∣Σ∣1/21exp(−21(x−u)TΣ−1(x−u))
where u is the mean vector.
Σ is the covariance matrix.
Example:
u=(0,0)
Σ=[0.250.300.301.00]
Mixture Models
A Mixture Model is the weighted sum of a number of PDFs.
Weights are determined by a distribution π<em>0,π</em>1,π2
Mixture Model Equation
The probability density function p(x) is given by:
p(x)=π<em>0f</em>0(x)+π<em>1f</em>1(x)+π<em>2f</em>2(x)
π<em>0,π</em>1,π2 are the mixing proportions.
f<em>0(x),f</em>1(x),f2(x) are the component densities.
Why GMM?
GMM creates a new PDF for generating random variables.
It is a generative model.
It clusters different components using Gaussian distributions.
Provides inferring opportunity.
Soft assignment of data points to clusters.
Intuition Behind GMM
Consider a histogram of temperature readings.
Two distributions may indicate data from two different cities.
Formulate as mathematics with:
Observable variable: temperature.
Latent variable: cities (z).
Gaussian Mixture Models: Mathematical Notation
For the general case, π is a vector of probabilities (non-negative values which sum to 1).
π is known as the mixing proportions.
Gaussian Mixture Models: PDF
The probability density function (PDF) over x is computed by marginalizing out (summing out) z:
This PDF is a convex combination, or weighted average, of the PDFs of the component distributions.
Posterior Inference
Assume parameters of the model have been chosen.
Goal: Infer, given a data point x, which component it likely belongs to.
In mathematical terms, infer the posterior distribution p(z∣x).
Posterior distribution can be inferred using Bayes’ Rule.
Example I
Using a previous example, suppose we observe x=2 in the model.
We want to compute the posterior probability Pr(z=1∣x).
Example II
Observations are two-dimensional (x1, x2).
We observe x1 and want to predict x2 using the posterior predictive distribution.
Example II: Two-Dimensional Mixture of Gaussian Model
Have a two-dimensional mixture of Gaussian model where x1 and x2 are conditionally independent given z.
Suppose we observe x1=3.
We can compute the posterior distribution just like in the previous example.
Example II: Posterior Predictive Distribution
Compute the posterior predictive distribution using the posterior: p(x<em>2∣x</em>1)=Pr(z=1∣x<em>1)p(x</em>2∣z=1)+Pr(z=2∣x<em>1)p(x</em>2∣z=2) =0.213Gaussian(x<em>2;6,1)+0.787Gaussian(x</em>2;3,2)
Learning
Parameters of GMM:
Mean μ<em>k and standard deviation σ</em>k associated with each component k.
Mixing proportions πk, defined as Pr(z=k).
Idea:
The model performs inferencing repeatedly to learn the parameters.
Learning: Maximum Likelihood Estimation (MLE)
Use Maximum Likelihood Estimation (MLE) to solve the parameter learning problem.
Learning: Log-Likelihood Derivatives
Compute log-likelihood derivatives by setting the derivatives to 0, or use gradient descent.
θ can be any parameter to learn, such as mixing proportion, mean, or standard deviation of a component.
Expected derivative of the joint log probability.
Learning: Optimization of Means
Optimization of means: lnp(x∣π,μ,Σ)=∑<em>n=1N∑</em>k=1KT<em>nkln(π</em>kN(x<em>n∣μ</em>k,Σ<em>k))∂μ</em>k∂lnp(x∣π,μ,Σ)=∑<em>n=1NT</em>nkΣ<em>k−1(x</em>n−μ<em>k)=0μ</em>k=∑</em>n=1NTnk∑<em>n=1NT</em>nkx<em>n
Learning: Optimization of Covariance
Optimization of covariance: Σ<em>k=∑</em>n=1NTnk∑</em>n=1NT<em>nk(x</em>n−μ<em>k)(x</em>n−μ<em>k)T
Learning: Optimization of Mixing Term
Optimization of mixing term: lnp(π∣π,μ,Σ)+λ(∑<em>k=1Kπ</em>k−1)
π<em>k=NN</em>k
Where
N<em>k=∑</em>n=1NTnk
MLE of a GMM
MLE of a GMM: μ<em>k=N</em>k1∑<em>n=1NT(z</em>nk)x<em>nΣ</em>k=N<em>k1∑</em>n=1NT(z<em>nk)(x</em>n−μ<em>k)(x</em>n−μ<em>k)Tπ</em>k=NN<em>kN</em>k=∑<em>n=1NT(z</em>nk)
Not a closed form solution!!
Use Expectation-Maximization Algorithm
Take-Home Messages
The generative process of Gaussian Mixture Model
Inferring cluster membership based on a learned GMM