code: def msll(y_true, y_pred, y_var, y_train):
      
  
      var = y_train.var()
      mu = y_train.mean()
  
      ll_naive = norm.logpdf(y_true, loc=mu, scale=np.sqrt(var))
      ll_mod = norm.logpdf(y_true, loc=y_pred, scale=np.sqrt(y_var))
  
      return - (ll_mod - ll_naive).mean()
docs: Mean standardised log loss under a Gaussian distribution.
  
      Parameters
      ----------
      y_true: ndarray
          vector of true targets
      y_pred: ndarray
          vector of predicted targets
      y_var: float or ndarray
          predicted variances
      y_train: ndarray
          vector of *training* targets by which to standardise
  
      Returns
      -------
      float:
          The negative mean standardised log loss (negative log likelihood)
  
      Example
      -------
      >>> y_true = np.random.randn(100)
      >>> msll(y_true, y_true, 1, y_true) < 0  # Should be good predictor
      True
      >>> msll(y_true, np.random.randn(100), 1, y_true) >= 0  # naive predictor
      True