⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bhattach.m

📁 bayeserr - Computes the Bayesian risk for optimal classifier. % bayescln - Classifier based on Baye
💻 M
字号:
function [eps]=bhattach(M1,M2,C1,C2,P1,P2)
% BHATTACH upper estimate on Bayes class. error.
%  [eps]=bhattach(M1,M2,C1,C2,P1,P2)
%
% BHATTACH calculates Bhattacharya's limit, i.e. upper estimate
%   of mean classification error for Bayesian classifier
%   minimizing errorneous classification into two classes for
%   normally (Gauss) distributed conditional probabilities p(x|k).
%   The conditional probabilities are  p(x|k) are described by
%   a pair of mean value and covariance matrix.
%
% Input:
%   M1 [Nx1] - mean value for class 1
%   M2 [Nx1] - mean value for class 2
%   C1 [NxN] - covariance matrix for class 1
%   C2 [NxN] - covariance matrix for class 2
%   P1 [1x1] - apriori probability for class 1
%   P2 [1x1] - apriori probability for class 2
%
%   where N is dimension of the feature space.
%
% Output:
%   eps - upper limint of the mean classification error
%
% See also BAYESCLN.
%

% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 02.01.2000
% Modifications
% 24. 6.00 V. Hlavac, comments into English.


M1=M1(:);
M2=M2(:);

d=(1/8)*(M2-M1)'*inv((C1+C2)/2)*(M2-M1)+(1/2)*...
    log( det((C1+C2)/2) / sqrt(det(C1)*det(C2)) );

eps=sqrt(P1*P2)*exp(-d);

⌨️ 快捷键说明

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