code: def mvn_nloglike_obs(x, sigma):
      """loglike multivariate normal
  
      assumes x is 1d, (nobs,) and sigma is 2d (nobs, nobs)
  
      brute force from formula
      no checking of correct inputs
      use of inv and log-det should be replace with something more efficient
      """
      # see numpy thread
      # Sturla: sqmahal = (cx*cho_solve(cho_factor(S),cx.T).T).sum(axis=1)
  
      # Still wasteful to calculate pinv first
      sigmainv = linalg.inv(sigma)
      cholsigmainv = linalg.cholesky(sigmainv)
      # 2 * np.sum(np.log(np.diagonal(np.linalg.cholesky(A)))) #Dag mailinglist
      # logdet not needed ???
      # logdetsigma = 2 * np.sum(np.log(np.diagonal(cholsigmainv)))
      x_whitened = np.dot(cholsigmainv, x)
  
      # sigmainv = linalg.cholesky(sigma)
      logdetsigma = np.log(np.linalg.det(sigma))
  
      sigma2 = 1.0  # error variance is included in sigma
  
      llike = 0.5 * (
          np.log(sigma2)
          - 2.0 * np.log(np.diagonal(cholsigmainv))
          + (x_whitened**2) / sigma2
          + np.log(2 * np.pi)
      )
  
      return llike, (x_whitened**2)
  
imports: import math
  import numpy
  from scipy import linalg, stats, special
  from .linalg_decomp_1 import SvdArray
label_desc: Use image node_id 4 for calling a global function with example usage: mvn_nloglike_obs(x, sigma) and returns: llike,  unknown