def E_distMahalanobis(self, X):
    Elambda = self.a / self.b
    if X.ndim == 2:
      weighted_SOS = np.sum( Elambda * np.square(X - self.m), axis=1)
    else:
      weighted_SOS = np.sum(Elambda * np.square(X - self.m))
    weighted_SOS += self.D/self.kappa
    return weighted_SOS

  ######################################################### Param updates 
  ######################################################### (M step)
Calculate E[ (x_n - \mu)^T diag(\lambda) (x_n - mu) ]
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/distr/GaussGammaDistr.py/GaussGammaDistr.E_distMahalanobis