link:http://www.mbfys.ru.nl/~robvdw/CNP04/LAB_ASSIGMENTS/LAB05_CN05/MATLAB2007b
/stats/@gmdistribution/fit.m源文件
%FIT Fit data to Gaussian mixture model
% G = GMDISTRIBUTION.FIT(X,K) creates an object G containing maximum
% likelihood estimates of the parameters in a Gaussian mixture model with
% K components for the data in X. X is an N-by-D matrix. Rows of X
% correspond to points; columns correspond to variables. The
% estimation uses the Expectation Maximization (EM) algorithm.
%
% GMDISTRIBUTION treats NaNs as missing data. Rows of X with NaNs are
% excluded from the fit.
%
% G = GMDISTRIBUTION.FIT(...,'PARAM1',val1,'PARAM2',val2,...)
% provides more control over the iterative EM algorithm. Parameters
% and values are listed below.
%
% 'Start' Method used to choose initial component parameters.
% There are three choices:
%
% 'randSample' Select K observations from X at random as the
% initial component means. The mixing
% proportions are uniform. The initial
% covariance matrices for all clusters are
% diagonal, where the Jth element on the diagonal
% is the variance of X(:,J). This is the default.
%
% A structure array S containing the following fields:
%