Skip to content
DeepForgeby svx
All problems
HardCalculusca-248

Gaussian Mean Fisher Information Matrix

Problem

For a multivariate Gaussian N(mu, Sigma), the Fisher information about the mean is the inverse covariance Sigma^{-1}.

Given the entries s11, s12, s22 of the symmetric 2x2 covariance, return the 2x2 Fisher matrix as a nested list. Return None when the determinant is not strictly positive.

Hint

The covariance inverse is the precision matrix, and it scales the mean information.

Test cases

case 1
in: [1,0,1]
expected: [[1,0],[0,1]]
case 2
in: [2,0,4]
expected: [[0.5,0],[0,0.25]]
case 3
in: [4,1,2]
expected: [[0.2857142857142857,-0.14285714285714285],[-0.14285714285714285,0.5714285714285714]]
case 4
in: [1,1,1]
expected: null
Starter codePython
def fisher_gaussian_mean(s11, s12, s22):
    # Return the 2x2 Fisher matrix
    # Your code here
    pass

4 test cases · run your code against them in the editor