normald.m

来自「this a SVM toolbox,it is very useful for」· M 代码 · 共 26 行

M
26
字号
function [p]=normald(X,mi,sigma)
% [p]=normald(X,mi,sigma)
%
% NORMALD calculates the value of many-dimensional probability density
%   of the normal (Gaussian) distribution for given vectors in the
%   matrix X and parameters of the normal distribution mi, sigma.
%
% Input:
%   x [NxK]  - matrix K of input vectors for which the density is calculated
%   mi [Nx1] - vector of mean values
%   sigma [NxN] - covariance matrix
%
%  where N is the dimension of the feature space.
%
% Output:
%   p[1xK] - the value of the probability density
%
% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 19.03.2000
% Modifications
% 24. 6.00 V. Hlavac, comments changed to English.

DIM=size(X,1);
p=exp(-1/2*mahalan(X,mi,sigma))/((2*pi)^(DIM/2) * sqrt(det(sigma)));

⌨️ 快捷键说明

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