Description Usage Arguments Value Examples
Compute the base-b
mutual information between two random variables.
1 | shannon_mutual_info(p_xy, p_x, p_y, b = 2)
|
p_xy |
Dist specifying the joint distribution. |
p_x |
Dist specifying the |
p_y |
Dist specifying the |
b |
Numeric giving the base of the logarithm. |
Numeric giving the Shannon mutual information.
1 2 3 4 5 6 | xy <- Dist(c(10, 70, 15, 5))
x <- Dist(c(80, 20))
y <- Dist(c(25, 75))
shannon_mutual_info(xy, x, y) # 0.2141709
shannon_mutual_info(xy, x, y, b = 3) # 0.1351268
shannon_mutual_info(xy, x, y, b = 0) # 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.