def analytical_value_i_renyi(distr, alpha, par):
""" Analytical value of the Renyi mutual information.
Parameters
----------
distr : str
Name of the distribution.
alpha : float
Parameter of the Renyi mutual information.
par : dictionary
Parameters of the distribution. If distr = 'normal': par["cov"]
is the covariance matrix.
Returns
-------
i : float
Analytical value of the Renyi mutual information.
"""
if distr == 'normal':
c = par["cov"]
t1 = -alpha / 2 * log(det(c))
t2 = -(1 - alpha) / 2 * log(prod(diag(c)))
t3 = log(det(alpha * inv(c) + (1 - alpha) * diag(1 / diag(c)))) / 2
i = 1 / (alpha - 1) * (t1 + t2 - t3)
else:
raise Exception('Distribution=?')
return i
x_analytical_values.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录