approximate_gauss_by_gmm.m

来自「高斯滤波器 matlab toolbox For GMMs and Gauss」· M 代码 · 共 36 行

M
36
字号
function g = approximate_gauss_by_gmm(x,P,N,type)
%function g = approximate_gauss_by_gmm(x,P,N,type)
%
% INPUTS: 
%   x,P - mean and covariance matrix of a Gaussian
%   N - number of components in output gmm
%   type - method used
%
% OUTPUT:
%   g - gmm approximation of Gaussian
%
% This function is in alpha stage of development.
%
% Tim Bailey 2005.

if N == 1, type = 1; elseif nargin == 3, type = 2; end

switch type
case 1
    % Trivial solution
    g.w = ones(1,N)/N;
    g.x = repcol(x,N);
    g.P = repmat(P,[1,1,N]);
case 2
    % Kernels
    g = approximate_gauss_by_kernels(x,P,N);
    g.P = repmat(g.P, [1,1,N]);
otherwise
    error('Invalid type')
end
    
% Other ideas:
% - splitting algorithm
%       - using musso's criterion at each step ??
%       - split along principal axis, 1/2 covariance at each step 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?