def calcFisherInformation(sigma, invSigma=None, factorSigma=None):
 if (invSigma == None):
  invSigma = inv(sigma)
 if (factorSigma == None):
  factorSigma = cholesky(sigma)
 dim = sigma.shape[0]
 fim = [invSigma]
 for k in range(dim):
  D = invSigma[k:, k:].copy()
  D[(0, 0)] += (factorSigma[(k, k)] ** (-2))
  fim.append(D)
 return fim

def calcFisherInformation ( sigma , invSigma = None , factorSigma = None ) : if ( invSigma == None ) : invSigma = inv ( sigma ) if ( factorSigma == None ) : factorSigma = cholesky ( sigma ) dim = sigma . shape [ 0 ] fim = [ invSigma ] for k in range ( dim ) : D = invSigma [ k : , k : ] . copy ( ) D [ ( 0 , 0 ) ] += ( factorSigma [ ( k , k ) ] ** ( - 2 ) ) fim . append ( D ) return fim
compute the exact fisher information matrix of a gaussian distribution .