original_docstring: Like :meth:`mahalanobis` but use a robust mean and covarance matrix by
          sampling the dataset.
  
          :param significance: 1 - the Chi^2 percent point function (inverse of
                               cdf / percentiles) outlier threshold; reasonable
                               values include 2.5%, 1%, 0.01%); if `None` use
                               :obj:`threshold` or :obj:`proportion`
  
          :return: indexes in to :obj:`data` rows (indexes of a dataframe) of the
                   outliers
  
          
docstring: Like :meth:`mahalanobis` but use a robust mean and covarance matrix by
  sampling the dataset.
docstring_tokens: Like : meth : ` mahalanobis ` but use a robust mean and covarance matrix by sampling the dataset .
code: def robust_mahalanobis(self, significance: float = 0.001,
                             random_state: int = 0) -> np.ndarray:
          """Like :meth:`mahalanobis` but use a robust mean and covarance matrix by
          sampling the dataset.
  
          :param significance: 1 - the Chi^2 percent point function (inverse of
                               cdf / percentiles) outlier threshold; reasonable
                               values include 2.5%, 1%, 0.01%); if `None` use
                               :obj:`threshold` or :obj:`proportion`
  
          :return: indexes in to :obj:`data` rows (indexes of a dataframe) of the
                   outliers
  
          """
          arr: np.ndarray = self.numpy
          # minimum covariance determinant
          rng = np.random.RandomState(random_state)
          # random sample of data, shape: (R, C)
          X: np.ndarray = rng.multivariate_normal(
              mean=np.mean(arr, axis=0),
              cov=np.cov(arr.T),
              size=arr.shape[0])
          # get robust estimates for the mean and covariance
          cov = MinCovDet(random_state=random_state).fit(X)
          # robust covariance metric; shape: (C, C)
          mcd: np.ndarray = cov.covariance_
          # robust mean, shape: (C,)
          rmean: np.ndarray = cov.location_
          # inverse covariance metric, shape: (C, C)
          inv_cov: np.ndarray = np.linalg.inv(mcd)
          # robust M-Distance, shape: (R, C)
          x_minus_mu: np.ndarray = arr - rmean
          # shape: (R, C)
          left_term: np.ndarray = np.dot(x_minus_mu, inv_cov)
          # m distance: shape: (R, R)
          dist: np.ndarray = np.dot(left_term, x_minus_mu.T)
          # distances: shape: (R,)
          md: np.ndarray = np.sqrt(dist.diagonal())
  
          C = self._set_chi_threshold(significance)
          return self._select_indicies(md, C)
code_tokens: def robust_mahalanobis ( self , significance : float = 0.001 , random_state : int = 0 ) -> np . ndarray : arr : np . ndarray = self . numpy rng = np . random . RandomState ( random_state ) X : np . ndarray = rng . multivariate_normal ( mean = np . mean ( arr , axis = 0 ) , cov = np . cov ( arr . T ) , size = arr . shape [ 0 ] ) cov = MinCovDet ( random_state = random_state ) . fit ( X ) mcd : np . ndarray = cov . covariance_ rmean : np . ndarray = cov . location_ inv_cov : np . ndarray = np . linalg . inv ( mcd ) x_minus_mu : np . ndarray = arr - rmean left_term : np . ndarray = np . dot ( x_minus_mu , inv_cov ) dist : np . ndarray = np . dot ( left_term , x_minus_mu . T ) md : np . ndarray = np . sqrt ( dist . diagonal ( ) ) C = self . _set_chi_threshold ( significance ) return self . _select_indicies ( md , C )
short_docstring: Like :meth:`mahalanobis` but use a robust mean and covarance matrix by
  sampling the dataset.
short_docstring_tokens: Like : meth : ` mahalanobis ` but use a robust mean and covarance matrix by sampling the dataset .
comment: """Like :meth:`mahalanobis` but use a robust mean and covarance matrix by
          sampling the dataset.
  
          :param significance: 1 - the Chi^2 percent point function (inverse of
                               cdf / percentiles) outlier threshold; reasonable
                               values include 2.5%, 1%, 0.01%); if `None` use
                               :obj:`threshold` or :obj:`proportion`
  
          :return: indexes in to :obj:`data` rows (indexes of a dataframe) of the
                   outliers
  
          """$SEP$# minimum covariance determinant$SEP$# random sample of data, shape: (R, C)$SEP$# get robust estimates for the mean and covariance$SEP$# robust covariance metric; shape: (C, C)$SEP$# robust mean, shape: (C,)$SEP$# inverse covariance metric, shape: (C, C)$SEP$# robust M-Distance, shape: (R, C)$SEP$# shape: (R, C)$SEP$# m distance: shape: (R, R)$SEP$# distances: shape: (R,)