【问题标题】:Entropy and Mutual Information in RR中的熵和互信息
【发布时间】:2016-10-02 20:59:28
【问题描述】:

我想在 R 中计算条件互信息,我使用了名为 infotheo 的包。

我使用了两种方法来计算 I(X;Y1,Y2|Z)。首先是使用如下代码,

condinformation(X$industry,cbind(X$ethnicity,X$education),S=X$gender, method="emp")
[1] -1.523344

而且我认为互信息可以分解为两个熵:I(X;Y1,Y2|Z)=H(X|Z)-H(X|​​Z,Y1,Y2),我使用了以下代码,

hhh<-condentropy(X$industry, Y=X$gender, method="emp")
hhh1<-condentropy(X$industry,Y=cbind(X$gender,X$ethnicity,X$education))
hhh-hhh1
[1] 0.1483363

我想知道为什么这两个给了我不同的结果?

【问题讨论】:

标签: r entropy information-theory


【解决方案1】:

这两种方法是不同的估计量,因此会给出不同的结果,就像下面两个对随机变量 a 和 b 之和的方差的估计量给出不同的结果一样:

> a <- rnorm(100)
> b <- rnorm(100)
> var(a+b)-(var(a)+var(b))
[1] 0.5219229

不确定哪种估算器更适合您的情况,但我猜是第一个。您可以从您的模型中进行一些模拟以获得更好的想法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-02-14
    • 2014-07-04
    • 2010-12-27
    • 2011-07-24
    • 2014-07-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多