All problems
Total Correlation of Gaussian Pair
Problem
Return the total correlation in bits of a bivariate Gaussian with correlation coefficient rho:
TC = -0.5 * log2(1 - rho^2)
The total correlation is the KL divergence from the joint to the product of its marginals.
Hint
Uncorrelated Gaussian variables carry no total correlation.
Test cases
case 1
in: [0]
expected: 0
case 2
in: [0.5]
expected: 0.2075187496394219
case 3
in: [0.9]
expected: 1.1979643381655698
case 4
in: [0.8]
expected: 0.7369655941662064
Starter codePython
import math
def total_correlation_gaussian(rho):
# Your code here
pass4 test cases · run your code against them in the editor