
    0Ph                         d Z ddlZddlmZmZ ddlZddlmZ ddl	m
Z
 ddlmZ ddlmZmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ dddedfdZdddefdZdddedfdZdedfdZ G d de          ZdS )zn
Robust location and covariance estimators.

Here are implemented estimators that are resistant to outliers.

    N)IntegralReal)linalg)chi2   )_fit_context)check_arraycheck_random_state)Interval)fast_logdet)validate_data   )EmpiricalCovarianceempirical_covariance   Fc           	      t    t          j        |           } t          |          }t          | ||||||          S )aS  C_step procedure described in [Rouseeuw1984]_ aiming at computing MCD.

    Parameters
    ----------
    X : array-like of shape (n_samples, n_features)
        Data set in which we look for the n_support observations whose
        scatter matrix has minimum determinant.

    n_support : int
        Number of observations to compute the robust estimates of location
        and covariance from. This parameter must be greater than
        `n_samples / 2`.

    remaining_iterations : int, default=30
        Number of iterations to perform.
        According to [Rouseeuw1999]_, two iterations are sufficient to get
        close to the minimum, and we never need more than 30 to reach
        convergence.

    initial_estimates : tuple of shape (2,), default=None
        Initial estimates of location and shape from which to run the c_step
        procedure:
        - initial_estimates[0]: an initial location estimate
        - initial_estimates[1]: an initial covariance estimate

    verbose : bool, default=False
        Verbose mode.

    cov_computation_method : callable,             default=:func:`sklearn.covariance.empirical_covariance`
        The function which will be used to compute the covariance.
        Must return array of shape (n_features, n_features).

    random_state : int, RandomState instance or None, default=None
        Determines the pseudo random number generator for shuffling the data.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    Returns
    -------
    location : ndarray of shape (n_features,)
        Robust location estimates.

    covariance : ndarray of shape (n_features, n_features)
        Robust covariance estimates.

    support : ndarray of shape (n_samples,)
        A mask for the `n_support` observations whose scatter matrix has
        minimum determinant.

    References
    ----------
    .. [Rouseeuw1999] A Fast Algorithm for the Minimum Covariance Determinant
        Estimator, 1999, American Statistical Association and the American
        Society for Quality, TECHNOMETRICS
    remaining_iterationsinitial_estimatesverbosecov_computation_methodrandom_state)npasarrayr
   _c_step)X	n_supportr   r   r   r   r   s          e/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sklearn/covariance/_robust_covariance.pyc_stepr   !   sK    B 	
1A%l33L	1+5!       c                    | j         \  }}t          j        }	||                    |          d |         }
nt|d         }|d         }t	          j        |          }| |z
  }t          j        ||          |z                      d          }	t          j        |	|dz
            d |         }
| |
         }|	                    d          } ||          }t          |          }t          j        |          rt	          j        |          }t          j        }||k     r|dk    rt          j        |          s|}|}|}|
}t	          j        |          }| |z
  }t          j        ||          |z                      d          }	t          j        |	|dz
            d |         }
| |
         }|	                    d          } ||          }t          |          }|dz  }||k     r|dk    rt          j        |          |	}t          j        | |z
  |          | |z
  z                      d          }	t          j        |          r||||
|	f}t          j        ||          r|rt          d|z             ||||
|	f}n0||k    r*t          j        d||||z  fz  t                      |||||f}|dk    r|rt          d           ||||
|	f}|\  }}}}
}	t          j        |
|                              t&                    }|||||	fS )Nr   r   axiszNOptimal couple (location, covariance) found before ending iterations (%d left)zDeterminant has increased; this should not happen: log(det) > log(previous_det) (%.15f > %.15f). You may want to try with a higher value of support_fraction (current value: %.3f).z$Maximum number of iterations reached)	minlength)shaper   infpermutationr   pinvhdotsumargpartitionmeanr   isinfallcloseprintwarningswarnRuntimeWarningbincountastypebool)r   r   r   r   r   r   r   	n_samples
n_featuresdistsupport_indiceslocation
covariance	precision
X_centered	X_supportdetprevious_detprevious_locationprevious_covarianceprevious_support_indicesprevious_distresultssupports                           r   r   r   o   s    GIz6D  &229==jyjI %Q'&q)
L,,	\
z9--
:??BB/$	A>>z	zJ/"I~~a  H''	22J j
!
!C 
x}} -L,,	6L


!5!9!9"(3--!9$(#2 L,,	\
z9--
:??Q?GG/$	A>>z	zJo&	>>q>))++I66
*%%!# 

!5!9!9"(3--!9& MF1x<++q8|<AAqAIID	x}} CJ_dB	{3%% 
 	/2FH   J_dB	|		6 L)i"78	9
 	
 	
 	
 $
 q   	:8999J_dB7>4Hj#k/Y???FFtLLGZgt33r    c                 N   t          |          }t          |t                    rd}nPt          |t                    rd}|}	|	d         j        d         }n#t          d|dt          |          d          g }
|s;t          |          D ]*}|
                    t          | |||||                     +nWt          |          D ]G}|	d         |         |	d         |         f}|
                    t          | ||||||	                     Ht          |
 \  }}}}}t          j        |          d
|         }t          j        |          |         }t          j        |          |         }t          j        |          |         }t          j        |          |         }||||fS )a  Finds the best pure subset of observations to compute MCD from it.

    The purpose of this function is to find the best sets of n_support
    observations with respect to a minimization of their covariance
    matrix determinant. Equivalently, it removes n_samples-n_support
    observations to construct what we call a pure data set (i.e. not
    containing outliers). The list of the observations of the pure
    data set is referred to as the `support`.

    Starting from a random support, the pure data set is found by the
    c_step procedure introduced by Rousseeuw and Van Driessen in
    [RV]_.

    Parameters
    ----------
    X : array-like of shape (n_samples, n_features)
        Data (sub)set in which we look for the n_support purest observations.

    n_support : int
        The number of samples the pure data set must contain.
        This parameter must be in the range `[(n + p + 1)/2] < n_support < n`.

    n_trials : int or tuple of shape (2,)
        Number of different initial sets of observations from which to
        run the algorithm. This parameter should be a strictly positive
        integer.
        Instead of giving a number of trials to perform, one can provide a
        list of initial estimates that will be used to iteratively run
        c_step procedures. In this case:
        - n_trials[0]: array-like, shape (n_trials, n_features)
          is the list of `n_trials` initial location estimates
        - n_trials[1]: array-like, shape (n_trials, n_features, n_features)
          is the list of `n_trials` initial covariances estimates

    select : int, default=1
        Number of best candidates results to return. This parameter must be
        a strictly positive integer.

    n_iter : int, default=30
        Maximum number of iterations for the c_step procedure.
        (2 is enough to be close to the final solution. "Never" exceeds 20).
        This parameter must be a strictly positive integer.

    verbose : bool, default=False
        Control the output verbosity.

    cov_computation_method : callable,             default=:func:`sklearn.covariance.empirical_covariance`
        The function which will be used to compute the covariance.
        Must return an array of shape (n_features, n_features).

    random_state : int, RandomState instance or None, default=None
        Determines the pseudo random number generator for shuffling the data.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    See Also
    ---------
    c_step

    Returns
    -------
    best_locations : ndarray of shape (select, n_features)
        The `select` location estimates computed from the `select` best
        supports found in the data set (`X`).

    best_covariances : ndarray of shape (select, n_features, n_features)
        The `select` covariance estimates computed from the `select`
        best supports found in the data set (`X`).

    best_supports : ndarray of shape (select, n_samples)
        The `select` best supports found in the data set (`X`).

    References
    ----------
    .. [RV] A Fast Algorithm for the Minimum Covariance Determinant
        Estimator, 1999, American Statistical Association and the American
        Society for Quality, TECHNOMETRICS
    FTr   z>Invalid 'n_trials' parameter, expected tuple or  integer, got z ())r   r   r   r   r   r   N)r
   
isinstancer   tupler%   	TypeErrortyperangeappendr   zipr   argsortr   )r   r   n_trialsselectn_iterr   r   r   run_from_estimatesestimates_listall_estimatesjr   all_locs_suball_covs_suball_dets_suball_supports_sub
all_ds_sub
index_bestbest_locationsbest_covariancesbest_supportsbest_dss                          r   select_candidatesrb      s   r &l33L(H%% 

"	He	$	$ 
!!!!$*1-ixxh)
 
 	
 M x 
	 
	A  )/#+A!-  	 	 	 	
	 x 	 	A!/!21!5~a7H7K L  )/&7#+A!-  
 
 
 
 NQ	NJL,.>
 L))'6'2JZ--j9Nz,//
;J/00<Mj$$Z0G+]GCCr    c           
      
   t          |          }t          | dd          } | j        \  }}|+t          t	          j        d||z   dz   z                      }nt          ||z            }|dk    r#||k     rmt	          j        t	          j        |                     }||d         |d||z
           z
  }t	          j        |t	          j	        |          k              d         }	d|||	z            ||	         z   
                                z  }
t	          j        |t                    }| |
z
  }d	|t	          j        t	          j        |          d          d|         <   t	          j        t	          j        | |                   gg          }t	          j        |
g          }
t%          j        |          }t	          j        ||          |z                      d
          }nt	          j        |t                    }t	          j        t	          j        |           gg          }t	          j        t	          j
        |           g          }
| |
z
  }t%          j        |          }t	          j        ||          |z                      d
          }|dk    rf|dk    r_|dz  }||z  }|                    |          }t          t	          j        ||t1          |          z  z                      }d}d}t3          d||z            }||z  }t	          j        ||f          }	 t	          j        |||f          }n+# t4          $ r d}t	          j        |||f          }d}Y nw xY wt7          |          D ]_}||z  }||z   }| |||                  }t9          ||||d||          \  }}} } t	          j        ||z  |dz   |z            }!|||!<   |||!<   `t          d|          }"t          t	          j        |"|t1          |          z  z                      }#|dk    rd}$nd}$|                    |          d|"         }%t9          | |%         |#||f|$||          \  }&}'}(})|dk     rV|&d         }
|'d         }t	          j        |t                    }t	          j        |          }|(d         ||%<   |)d         ||%<   nt9          | ||&|'fd||          \  }*}+},})|*d         }
|+d         }|,d         }|)d         }na|dk    r[d}d}-t9          | |||-d||          \  }.}/} } t9          | ||.|/fd||          \  }*}+},})|*d         }
|+d         }|,d         }|)d         }|
|||fS )ac
  Estimate the Minimum Covariance Determinant matrix.

    Read more in the :ref:`User Guide <robust_covariance>`.

    Parameters
    ----------
    X : array-like of shape (n_samples, n_features)
        The data matrix, with p features and n samples.

    support_fraction : float, default=None
        The proportion of points to be included in the support of the raw
        MCD estimate. Default is `None`, which implies that the minimum
        value of `support_fraction` will be used within the algorithm:
        `(n_samples + n_features + 1) / 2 * n_samples`. This parameter must be
        in the range (0, 1).

    cov_computation_method : callable,             default=:func:`sklearn.covariance.empirical_covariance`
        The function which will be used to compute the covariance.
        Must return an array of shape (n_features, n_features).

    random_state : int, RandomState instance or None, default=None
        Determines the pseudo random number generator for shuffling the data.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    Returns
    -------
    location : ndarray of shape (n_features,)
        Robust location of the data.

    covariance : ndarray of shape (n_features, n_features)
        Robust covariance of the features.

    support : ndarray of shape (n_samples,), dtype=bool
        A mask of the observations that have been used to compute
        the robust location and covariance estimates of the data set.

    Notes
    -----
    The FastMCD algorithm has been introduced by Rousseuw and Van Driessen
    in "A Fast Algorithm for the Minimum Covariance Determinant Estimator,
    1999, American Statistical Association and the American Society
    for Quality, TECHNOMETRICS".
    The principle is to compute robust estimates and random subsets before
    pooling them into a larger subsets, and finally into the full data set.
    Depending on the size of the initial sample, we have one, two or three
    such computation levels.

    Note that only raw estimates are returned. If one is interested in
    the correction and reweighting steps described in [RouseeuwVan]_,
    see the MinCovDet object.

    References
    ----------

    .. [RouseeuwVan] A Fast Algorithm for the Minimum Covariance
        Determinant Estimator, 1999, American Statistical Association
        and the American Society for Quality, TECHNOMETRICS

    .. [Butler1993] R. W. Butler, P. L. Davies and M. Jhun,
        Asymptotics For The Minimum Covariance Determinant Estimator,
        The Annals of Statistics, 1993, Vol. 21, No. 3, 1385-1400
    r   fast_mcdensure_min_samples	estimatorN      ?r   r   dtypeTr"   i  i,  
   )rR   rS   r   r   i  )rQ   rR   r   r   r   )rQ   rR   rS   r   r   )r
   r	   r%   intr   ceilsortravelwhereminr,   zerosr5   rP   absr   vararrayr   r(   r)   r*   onesr'   floatmaxMemoryErrorrM   rb   arange)0r   support_fractionr   r   r6   r7   r   X_sorteddiffhalves_startr:   rF   r=   r;   r<   r8   	n_subsetsn_samples_subsetssamples_shuffleh_subsetn_trials_tot
n_best_subrQ   
n_best_totall_best_locationsall_best_covariancesi	low_bound
high_boundcurrent_subsetbest_locations_subbest_covariances_sub_subset_slicen_samples_mergedh_mergedn_best_merged	selectionlocations_mergedcovariances_mergedsupports_mergeddlocations_fullcovariances_fullsupports_fulln_bestlocations_bestcovariances_bests0                                                   r   rd   rd   g  s<   L &l33LA!zBBBAGIz y:'='A BCCDD		(9455	
 Qy  wrx{{++HIJJ'(3Li)6K3L*MMD8DBF4LL$899!<L I458NNTTVVW  hy555GXJEIGBJrvj11155jyjABbfQwZ&8&8%9$:;;Jx
++HZ00IF:y11Z@EE1EMMDDgit444GbfQii[M22Jz271::,//HXJZ00IF:y11Z@EE1EMMDCj1nn $	%2&229==rw0Ii@P@P4PQRRSS
r<9455+
Xz:&>??	#%8ZZ,P#Q#Q   	 	 	 J#%8ZZ,P#Q#Q JJJ	 y!! 	F 	FA--I"%66Jy/CDEN=N!'=)> > >: 4a 9Q^a!ez5IJJL/A|,1E .. tY//rw/9uY?O?O3OPQQRRtMMM ,,Y778I9I8IJ	CTiL(*>? #9%D
 D
 D
@,oq t'*H+A.Jhy555G8I&&D!0!3GIdDOO BS*,>?'=)B B B>N,mQ &a(H)!,J#A&GQ4DD	a 1B#9%2
 2
 2
.(!Q >O$&67#9%>
 >
 >
:(- "!$%a(
"tZ$..s   )M %M)(M)c                       e Zd ZU dZi ej         eeddd          dgdgdZee	d	<    e
e          Zd
dddddZ ed
          dd            Zd Zd ZdS )	MinCovDeta  Minimum Covariance Determinant (MCD): robust estimator of covariance.

    The Minimum Covariance Determinant covariance estimator is to be applied
    on Gaussian-distributed data, but could still be relevant on data
    drawn from a unimodal, symmetric distribution. It is not meant to be used
    with multi-modal data (the algorithm used to fit a MinCovDet object is
    likely to fail in such a case).
    One should consider projection pursuit methods to deal with multi-modal
    datasets.

    Read more in the :ref:`User Guide <robust_covariance>`.

    Parameters
    ----------
    store_precision : bool, default=True
        Specify if the estimated precision is stored.

    assume_centered : bool, default=False
        If True, the support of the robust location and the covariance
        estimates is computed, and a covariance estimate is recomputed from
        it, without centering the data.
        Useful to work with data whose mean is significantly equal to
        zero but is not exactly zero.
        If False, the robust location and covariance are directly computed
        with the FastMCD algorithm without additional treatment.

    support_fraction : float, default=None
        The proportion of points to be included in the support of the raw
        MCD estimate. Default is None, which implies that the minimum
        value of support_fraction will be used within the algorithm:
        `(n_samples + n_features + 1) / 2 * n_samples`. The parameter must be
        in the range (0, 1].

    random_state : int, RandomState instance or None, default=None
        Determines the pseudo random number generator for shuffling the data.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    Attributes
    ----------
    raw_location_ : ndarray of shape (n_features,)
        The raw robust estimated location before correction and re-weighting.

    raw_covariance_ : ndarray of shape (n_features, n_features)
        The raw robust estimated covariance before correction and re-weighting.

    raw_support_ : ndarray of shape (n_samples,)
        A mask of the observations that have been used to compute
        the raw robust estimates of location and shape, before correction
        and re-weighting.

    location_ : ndarray of shape (n_features,)
        Estimated robust location.

    covariance_ : ndarray of shape (n_features, n_features)
        Estimated robust covariance matrix.

    precision_ : ndarray of shape (n_features, n_features)
        Estimated pseudo inverse matrix.
        (stored only if store_precision is True)

    support_ : ndarray of shape (n_samples,)
        A mask of the observations that have been used to compute
        the robust estimates of location and shape.

    dist_ : ndarray of shape (n_samples,)
        Mahalanobis distances of the training set (on which :meth:`fit` is
        called) observations.

    n_features_in_ : int
        Number of features seen during :term:`fit`.

        .. versionadded:: 0.24

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X`
        has feature names that are all strings.

        .. versionadded:: 1.0

    See Also
    --------
    EllipticEnvelope : An object for detecting outliers in
        a Gaussian distributed dataset.
    EmpiricalCovariance : Maximum likelihood covariance estimator.
    GraphicalLasso : Sparse inverse covariance estimation
        with an l1-penalized estimator.
    GraphicalLassoCV : Sparse inverse covariance with cross-validated
        choice of the l1 penalty.
    LedoitWolf : LedoitWolf Estimator.
    OAS : Oracle Approximating Shrinkage Estimator.
    ShrunkCovariance : Covariance estimator with shrinkage.

    References
    ----------

    .. [Rouseeuw1984] P. J. Rousseeuw. Least median of squares regression.
        J. Am Stat Ass, 79:871, 1984.
    .. [Rousseeuw] A Fast Algorithm for the Minimum Covariance Determinant
        Estimator, 1999, American Statistical Association and the American
        Society for Quality, TECHNOMETRICS
    .. [ButlerDavies] R. W. Butler, P. L. Davies and M. Jhun,
        Asymptotics For The Minimum Covariance Determinant Estimator,
        The Annals of Statistics, 1993, Vol. 21, No. 3, 1385-1400

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.covariance import MinCovDet
    >>> from sklearn.datasets import make_gaussian_quantiles
    >>> real_cov = np.array([[.8, .3],
    ...                      [.3, .4]])
    >>> rng = np.random.RandomState(0)
    >>> X = rng.multivariate_normal(mean=[0, 0],
    ...                                   cov=real_cov,
    ...                                   size=500)
    >>> cov = MinCovDet(random_state=0).fit(X)
    >>> cov.covariance_
    array([[0.7411..., 0.2535...],
           [0.2535..., 0.3053...]])
    >>> cov.location_
    array([0.0813... , 0.0427...])
    r   r   right)closedNr   )r{   r   _parameter_constraintsTFstore_precisionassume_centeredr{   r   c                >    || _         || _        || _        || _        d S Nr   )selfr   r   r{   r   s        r   __init__zMinCovDet.__init__  s*      /. 0(r    )prefer_skip_nested_validationc                    t          | |dd          }t          | j                  }|j        \  }}t	          j        t          j        |j        |                    dk    	                                |k    rt          j        d           t          || j        | j        |          \  }}}}	| j        rpt          j        |          }|                     ||         d          }t	          j        |          }
t          j	        t          j        ||
          |z  d	          }	|| _        || _        || _        || _        || _        |	| _        |                     |           |                     |           | S )
a  Fit a Minimum Covariance Determinant with the FastMCD algorithm.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training data, where `n_samples` is the number of samples
            and `n_features` is the number of features.

        y : Ignored
            Not used, present for API consistency by convention.

        Returns
        -------
        self : object
            Returns the instance itself.
        r   r   re   g:0yE>zAThe covariance matrix associated to your dataset is not full rank)r{   r   r   Tr   r   )r   r
   r   r%   r   svdvalsr   r)   Tr*   r0   r1   rd   r{   _nonrobust_covariancer   rr   r(   raw_location_raw_covariance_raw_support_	location_support_dist_correct_covariancereweight_covariance)r   r   yr   r6   r7   raw_locationraw_covarianceraw_supportraw_distr<   s              r   fitzMinCovDet.fit  s}   $ $a;OOO)$*;<< !	:N26!#q>>**T16688JFFMS   ?G!2#'#=%	?
 ?
 ?
;nk8  	;8J//L!77+ 8  N ^44IvbfQ	22Q6::H)-'%#
"""  ###r    c                    t          | j                  }t          j        | j                  }||k     r)t          j        | j        d          rt          d          t          j        | j                  t          |j
        d                                       d          z  }| j        |z  }| xj        |z  c_        |S )aL  Apply a correction to raw Minimum Covariance Determinant estimates.

        Correction using the empirical correction factor suggested
        by Rousseeuw and Van Driessen in [RVD]_.

        Parameters
        ----------
        data : array-like of shape (n_samples, n_features)
            The data matrix, with p features and n samples.
            The data set must be the one which was used to compute
            the raw estimates.

        Returns
        -------
        covariance_corrected : ndarray of shape (n_features, n_features)
            Corrected robust covariance estimate.

        References
        ----------

        .. [RVD] A Fast Algorithm for the Minimum Covariance
            Determinant Estimator, 1999, American Statistical Association
            and the American Society for Quality, TECHNOMETRICS
        r   zYThe covariance matrix of the support data is equal to 0, try to increase support_fractionr   rh   )lenr   r   r*   r   r.   r   
ValueErrormedianr   r%   isf)r   datar6   r   
correctioncovariance_correcteds         r   r   zMinCovDet.correct_covariance  s    8 
OO	F4=))	y  R[1Eq%I%I B   Ytz**T$*Q--@-@-D-DS-I-II
#3j@

j 

##r    c                 F   |j         \  }}| j        t          |                              d          k     }| j        rt          j        |          }n||                             d          }|                     ||         | j                  }t          j        |t                    }d||<   | 
                    |           || _        || _        || j        z
  }t          j        t          j        ||                                           |z  d          | _        |||fS )a  Re-weight raw Minimum Covariance Determinant estimates.

        Re-weight observations using Rousseeuw's method (equivalent to
        deleting outlying observations from the data set before
        computing location and covariance estimates) described
        in [RVDriessen]_.

        Parameters
        ----------
        data : array-like of shape (n_samples, n_features)
            The data matrix, with p features and n samples.
            The data set must be the one which was used to compute
            the raw estimates.

        Returns
        -------
        location_reweighted : ndarray of shape (n_features,)
            Re-weighted robust location estimate.

        covariance_reweighted : ndarray of shape (n_features, n_features)
            Re-weighted robust covariance estimate.

        support_reweighted : ndarray of shape (n_samples,), dtype=bool
            A mask of the observations that have been used to compute
            the re-weighted robust location and covariance estimates.

        References
        ----------

        .. [RVDriessen] A Fast Algorithm for the Minimum Covariance
            Determinant Estimator, 1999, American Statistical Association
            and the American Society for Quality, TECHNOMETRICS
        g?r   r   ri   Tr   )r%   r   r   r   r   r   rr   r,   r   r5   _set_covariancer   r   r*   r)   get_precision)	r   r   r6   r7   masklocation_reweightedcovariance_reweightedsupport_reweightedr=   s	            r   r   zMinCovDet.reweight_covariance4  s   D !%
	:zD,,00777 	5"$(:"6"6"&t*//!"4"4 $ : :J(< !; !
 !
  Xit<<<#'4 2333,*DN*
VBF:t/A/A/C/CDDzQSTUU
"$9;MMMr    r   )__name__
__module____qualname____doc__r   r   r   r   dict__annotations__staticmethodr   r   r   r   r   r   r    r    r   r   r   E  s        z zx$

4$%XdAqAAA4H'($ $ $D   
 )L)=>>
 ) ) ) ) ) \5553 3 3 653j&$ &$ &$P2N 2N 2N 2N 2Nr    r   )r   r0   numbersr   r   numpyr   scipyr   scipy.statsr   baser   utilsr	   r
   utils._param_validationr   utils.extmathr   utils.validationr   _empirical_covariancer   r   r   r   rb   rd   r   r   r    r   <module>r      s     " " " " " " " "                       3 3 3 3 3 3 3 3 . . . . . . ' ' ' ' ' ' , , , , , , L L L L L L L L /K K K Kd /c4 c4 c4 c4T /OD OD OD ODh /	[/ [/ [/ [/|aN aN aN aN aN# aN aN aN aN aNr    