期望值最大化算法 EM_GMM 估计高斯混合模型

EM Algorithm for Gaussian Mixture Model (EM GMM)

注释:

This is a function tries to obtain the maximum likelihood estimation of Gaussian mixture model by expectation maximization (EM) algorithm. 
It works on data set of arbitrary dimensions. Several techniques are applied to avoid the float number underflow problems that often occurs when computing probability of high dimensional data. Also the code is carefully tuned to be efficient by utilizing vertorization and matrix factorization. 
This is a widely used algorithm. The detail of this algorithm can be found in many textbooks or tutorials online. Just google EM Gaussian Mixture or you can read the wiki page: 
http://en.wikipedia.org/wiki/Expectation-maximization_algorithm 
This function is robust and efficient yet the code structure is organized so that it is easy to read. Please try following code for a demo: 
close all; clear; 
d = 2; 
k = 3; 
n = 500; 
[X,label] = mixGaussRnd(d,k,n); 
plotClass(X,label);

m = floor(n/2); 
X1 = X(:,1:m); 
X2 = X(:,(m+1):end); 
% train 
[z1,model,llh] = mixGaussEm(X1,k); 
figure; 
plot(llh); 
figure; 
plotClass(X1,z1); 
% predict 
z2 = mixGaussPred(X2,model); 
figure; 
plotClass(X2,z2);



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值