code: def mvn_loglike(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)
      sigmainv = linalg.inv(sigma)
      logdetsigma = np.log(np.linalg.det(sigma))
      nobs = len(x)
  
      llf = -np.dot(x, np.dot(sigmainv, x))
      llf -= nobs * np.log(2 * np.pi)
      llf -= logdetsigma
      llf *= 0.5
      return llf
  
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 2 for calling a global function with example usage: mvn_loglike(x, sigma) and returns: llf