gauss_entropy.m

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

M
23
字号
function H = gauss_entropy(P)
%function H = gauss_entropy(P)
%
% INPUT:  P - covariance matrix
% OUTPUT: H - entropy
%
% The distribution entropy of a Gaussian is dependent only on the
% covariance, not the mean. For any fixed dimension, H is proportional to
% det(P).
%
% Tim Bailey 2007. 

e = exp(1);
d = size(P,1);
H = 0.5 * log((2*pi*e)^d * det(P));

% Alternatives:
%   log((2*pi*e)^d) = d*(1+log(2*pi))
%   so we could write:
%       H = 0.5 * (log((2*pi*e)^d) + log(det(P)))
%         = 0.5 * (d*(1+log(2*pi)) + log(det(P)))
%         = 0.5 * (d + d*log(2*pi) + log(det(P)))

⌨️ 快捷键说明

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