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 = np.linalg.inv(sigma)
      cholsigmainv = np.linalg.cholesky(sigmainv).T
      # 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
  
file_path: statsmodels/statsmodels/miscmodels/try_mlecov.py
imports: import numpy
  from scipy import linalg
  from scipy.linalg import toeplitz
  from statsmodels.base.model import GenericLikelihoodModel
  from statsmodels.datasets import sunspots
  from statsmodels.tsa.arima_process import ArmaProcess, arma_acovf, arma_generate_sample
label_desc: Use image node_id 4 for calling a global function with example usage: mvn_nloglike_obs(x, sigma) and returns: llike