parameters: (resp, X, nk, means, reg_covar)
return_statement: return covariance
docstring: Estimate the tied covariance matrix.
  
      Parameters
      ----------
      resp : array-like, shape (n_samples, n_components)
  
      X : array-like, shape (n_samples, n_features)
  
      nk : array-like, shape (n_components,)
  
      means : array-like, shape (n_components, n_features)
  
      reg_covar : float
  
      Returns
      -------
      covariance : array, shape (n_features, n_features)
          The tied covariance matrix of the components.
docstring_summary: Estimate the tied covariance matrix.
docstring_tokens: Estimate the tied covariance matrix .
function: def _estimate_gaussian_covariances_tied(resp, X, nk, means, reg_covar):
      """Estimate the tied covariance matrix.
  
      Parameters
      ----------
      resp : array-like, shape (n_samples, n_components)
  
      X : array-like, shape (n_samples, n_features)
  
      nk : array-like, shape (n_components,)
  
      means : array-like, shape (n_components, n_features)
  
      reg_covar : float
  
      Returns
      -------
      covariance : array, shape (n_features, n_features)
          The tied covariance matrix of the components.
      """
      avg_X2 = np.dot(X.T, X)
      avg_means2 = np.dot(nk * means.T, means)
      covariance = avg_X2 - avg_means2
      covariance /= nk.sum()
      covariance.flat[::len(covariance) + 1] += reg_covar
      return covariance
function_tokens: def _estimate_gaussian_covariances_tied ( resp , X , nk , means , reg_covar ) : avg_X2 = np . dot ( X . T , X ) avg_means2 = np . dot ( nk * means . T , means ) covariance = avg_X2 - avg_means2 covariance /= nk . sum ( ) covariance . flat [ : : len ( covariance ) + 1 ] += reg_covar return covariance