【问题标题】:How to get a likelihood using Mixture of Gaussian Model如何使用混合高斯模型获得可能性
【发布时间】:2014-03-27 23:27:03
【问题描述】:

为了简化我的问题,我在这里创建了一个虚拟问题:我有两组训练数据,分别标记为 1 和 2。两个训练数据集都假设遵循混合高斯分布。我可以很容易地使用 Matlab 工具箱函数 (gmdistribution.fit) 来估计它们的均值和协方差。

然后我有一些测试数据集,假设使用类似于训练数据集 2 的 MoG 创建,但有噪声。我想计算我的测试数据集更有可能使用训练数据集 2 的 MoG 生成的似然概率。换句话说,我想获得我的测试数据集具有标签 2 的可能性。

您能否指出如何做到这一点?非常感谢。

注:

  1. 我的两个训练数据集的大小不同
  2. 两个训练数据集的分布重叠
  3. 测试数据集的大小比训练数据集

一些Matlab代码:

%% Mixture of Gassian 1 (Training set 1)
mean1                                   = [1 -2];
cov1                                    = [2 0; 0 .5];
mean2                                   = [0.5 -5];
cov2                                    = [1 0; 0 1];
trainingDataset1                        = [mvnrnd(mean1, cov1, 1000); mvnrnd(mean2, cov2, 1000)];

MoGOptions                              = statset('Display', 'final');
MoGObj1                                 = gmdistribution.fit(trainingDataset1, 2, 'Options', MoGOptions);

figure,
scatter(trainingDataset1(:,1), trainingDataset1(:,2), 10, '.')
hold on
ezcontour(@(x,y)pdf(MoGObj1,[x y]), [-8 6], [-8 2]);

%% Mixture of Gassian 2 (Training set 2)
mean4                                   = [0.5 -1];
cov4                                    = [1.5 0; 0 .8];
mean5                                   = [-2 -3];
cov5                                    = [1 0; 0 1];
mean6                                   = [-4 -2];
cov6                                    = [1 0; 0 1];
trainingDataset2                        = [mvnrnd(mean4, cov4, 500); mvnrnd(mean5, cov5, 500); mvnrnd(mean6, cov6, 500)];

MoGOptions                              = statset('Display', 'final');
MoGObj2                                 = gmdistribution.fit(trainingDataset2, 2, 'Options', MoGOptions);

figure,
scatter(trainingDataset2(:,1), trainingDataset2(:,2), 10, '.')
hold on
ezcontour(@(x,y)pdf(MoGObj2,[x y]), [-8 6], [-8 2]);

%% Test set
mean7                                   = [1.1 -2.1];
cov7                                    = [2.2 0; 0 .4];
mean8                                   = [0.3 -5.4];
cov8                                    = [1.2 0; 0 1.1];
testingDataset1                         = [mvnrnd(mean7, cov7, 100); mvnrnd(mean8, cov8, 100)];

figure,
scatter(testingDataset1(:,1), testingDataset1(:,2), 10, '.')

【问题讨论】:

    标签: matlab machine-learning gaussian mixture-model


    【解决方案1】:

    我觉得AIC和BIC都很方便。

    尝试“struct(MoGObj2)”以获得适合您的领域的理想选择。

    其中一个是 NLogL,它是对数似然的负数。我想这就是你要找的。​​p>

    http://www.mathworks.com/help/stats/gmdistributionclass.html

    祝你好运

    【讨论】:

      猜你喜欢
      • 2018-07-16
      • 2021-12-28
      • 2021-09-30
      • 2018-05-17
      • 2019-08-05
      • 2016-12-28
      • 2023-03-24
      • 2014-01-09
      • 2012-05-08
      相关资源
      最近更新 更多