distance_normalised.m

来自「This a collection of MATLAB functions fo」· M 代码 · 共 32 行

M
32
字号
function N = distance_normalised(v, S)
%function N = distance_normalised(v, S)
%
% INPUTS:
%   v - set of innovation vectors
%   S - innovation covariance matrix
%
% OUTPUTS:
%   N - normalised distance: v'*inv(S)*v + log(det(S))
%
% NOTES:
%   The normalised distance is derived from the Gaussian likelihood
% function, and is proportional to the negative log-likelihood. It
% is obtained by taking logs, multiplying by -2 and subtracting D*log(2*pi)
% where D is the dimension of v.
%
%   N = -2*gauss_likelihood(v,S,1) - size(v,1)*log(2*pi);
% 
% It is often used as a metric for "nearest neighbours" data association
% (eg, see S.S. Blackman and R. Popoli. "Design and Analysis of Modern Tracking 
% Systems". Artech House Radar Library, 1999).
%
% Tim Bailey 2005.

Sc = chol(S)';
nv = Sc\v; 
N = sum(nv.*nv, 1) + 2*sum(log(diag(Sc)));

% Alternatives:
%   N = distance_mahalanobis(v, S) + log(det(S));
%   N = -2*gauss_likelihood(v,S,1) - size(v,1)*log(2*pi);

⌨️ 快捷键说明

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