def _log_multivariate_normal_density_spherical(X, means, covars):
 cv = covars.copy()
 if (covars.ndim == 1):
  cv = cv[:, np.newaxis]
 if (cv.shape[1] == 1):
  cv = np.tile(cv, (1, X.shape[(-1)]))
 return _log_multivariate_normal_density_diag(X, means, cv)

def _log_multivariate_normal_density_spherical ( X , means , covars ) : cv = covars . copy ( ) if ( covars . ndim == 1 ) : cv = cv [ : , np . newaxis ] if ( cv . shape [ 1 ] == 1 ) : cv = np . tile ( cv , ( 1 , X . shape [ ( - 1 ) ] ) ) return _log_multivariate_normal_density_diag ( X , means , cv )
compute gaussian log-density at x for a spherical model .