在matlab中确定模型的精度

在matlab中确定模型的精度,matlab,plot,modeling,Matlab,Plot,Modeling,我目前正试图绘制一些曲线图,表明GMM比MNN(多模型正态分布)更擅长建模数据,但无法绘制两种拟合都适用的曲线图。这是我目前的代码: MU1 = [1 2]; SIGMA1 = [2 0; 0 .5]; MU2 = [4 6]; SIGMA2 = [1 0; 0 1]; rng(1); % For reproducibility X = [mvnrnd(MU1,SIGMA1,1000); mvnrnd(MU2,SIGMA2,1000)]; figure; scatter(X(:,

我目前正试图绘制一些曲线图,表明GMM比MNN(多模型正态分布)更擅长建模数据,但无法绘制两种拟合都适用的曲线图。这是我目前的代码:

MU1 = [1 2];
SIGMA1 = [2 0; 0 .5];
MU2 = [4 6];
SIGMA2 = [1 0; 0 1];


rng(1); % For reproducibility
X = [mvnrnd(MU1,SIGMA1,1000);
     mvnrnd(MU2,SIGMA2,1000)];

figure;
scatter(X(:,1),X(:,2),10,'.')


options = statset('Display','final');
gm = fitgmdist(X,2,'Options',options); % GMM fit
G = fitgmdist(X,1) % fit MNN - only 1 component are being  used
gmPDF = @(x,y)pdf(gm,[x y]);
F = @(x,y) pdf(G,[x y])

hold on
%h = ezcontour(gmPDF,[-3 10],[-3 10]);
d = ezcontour(F,[-3 10],[-3 10]);
title('Scatter Plot and PDF Contour')
hold off
%%
close all
我能看到情节,但我能打印出两者的准确性吗?
比如离群值的数量或者其他什么?

我可以看到散点图和等高线。你说的“准确”是什么意思?顺便说一下,最后一行“全部关闭”将关闭绘图窗口。最后一行是预期的。。我在想,如果数据与模型的拟合程度有一定的价值。。。目前看来,MVN的性能似乎优于GMM。不清楚使用GMM和使用MNN计算拟合的位置。你能给代码添加一些注释吗?添加了@ammportal