Conditional Entropy

版本 1.0.0.0 (1.4 KB) 作者: Will Dwinnell
Calculates the conditional entropy of a discrete variable, given other discrete variables.
2.5K 次下载
更新时间 2010/9/12

查看许可证

ConditionalEntropy: Calculates conditional entropy (in bits) of Y, given X

H = ConditionalEntropy(Y,X)

H = calculated entropy of Y, given X (in bits)
Y = dependent variable (column vector)
X = independent variable(s)

Note 1: Each distinct value is considered a unique symbol.

Note 2: requires 'Entropy' and 'MutualInformation' functions

Example: 'X' (1 bit of entropy), 'Y' (2 bits of entropy)
Given 'X', 'Y's conditional entropy is 1 bit.

Note: Estimated entropy values are slightly less than true, due to finite sample size.

Y = ceil(4 * rand(1e3,1)); X = double(Y <= 2);
ConditionalEntropy(Y,X)

引用格式

Will Dwinnell (2025). Conditional Entropy (https://www.mathworks.com/matlabcentral/fileexchange/28693-conditional-entropy), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R12
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Calculus 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0