+
    ,i              	           ^ RI t^ RIHt ^ RIHtHtHt ^ RIH	t	 R.t
R tR tR tR	 t]	! ]R
^]^^R7      R^ RRRR/R l4       tR# )    N)stats)_SimpleNormalSignificanceResult_get_pvalue)_axis_nan_policy_factorychatterjeexic           	         V P                   R,          p\        P                  ! V RR7      p\        P                  ! WA4      w  rA\        P                  ! WRR7      p\
        P                  ! VRRR7      p\
        P                  ! V) RRR7      p\        P                  ! \        P                  ! \        P                  ! VRR7      4      RR7      pV'       d'   ^^V,          V^,          ^,
          ,          ,
          pMB^\        P                  ! W6,
          V,          RR7      ,          p	^W7,          V	,          ,
          pWV3# )   axismax)methodr   )
shapenpargsortbroadcast_arraystake_along_axisr   rankdatasumabsdiff)
xyy_continuousnjrlnum	statisticdens
   &&&       :/usr/lib/python3/dist-packages/scipy/stats/_correlation.py_xi_statisticr$      s     	
A 	

12Aq$DA
1b)A 	qR0A 	r%b1A
&&+,2
6CC16A:..	"&&!%12..#%	?    c                 j   \         P                  ! V P                  R,          4      pV'       d2   \         P                  ! R4      \         P                  ! V4      ,          # \         P                  ! ^V^,           4      p\         P
                  ! V RR7      p\         P                  ! VRR7      p^V^,          ,          \         P                  ! ^V,          ^V,          ,
          ^,           V^,          ,          RR7      ,          p^V^,          ,          \         P                  ! WcV,
          V,          ,           ^,          RR7      ,          p^V^,          ,          \         P                  ! ^V,          ^V,          ,
          ^,           V,          RR7      ,          p	^V^,          ,          \         P                  ! WV,
          ,          RR7      ,          p
V^V,          ,
          V	^,          ,           V
^,          ,          p\         P                  ! V4      \         P                  ! V4      ,          # )r
   r   r   g?)r   float64r   sqrtarangesortcumsumr   )r   r   r   r   iuvanbncndntau2s   &&&         r#   _xi_stdr4   *   sa    	

1772;A wwu~
**
 			!QUA
A
		!"A	
QTBFFAaC!A#IMQT1;	;B	
QTBFFAQ	MA-B7	7B	
QTBFFAaC!A#IMQ.R8	8B	
QTBFFAQKr2	2B2IAQ&D774=2771:%%r%   c                     V R9  d   \        R4      h\        V\        P                  4      '       g%   VP	                  4       pRpVR8w  d   \        V4      hW3# )Tz`y_continuous` must be boolean.z@`method` must be 'asymptotic' or a `PermutationMethod` instance.
asymptotic>   FT)
ValueError
isinstancer   PermutationMethodlower)r   r   messages   && r#   _chatterjeexi_ivr<   D   sW     =(:;;fe5566T\!W%%r%   c                 2    V P                   V P                  3# )N)r!   pvalue)res_s   &&r#   _unpackrA   T   s    ==#**$$r%   T)paired	n_samplesresult_to_tuple	n_outputs	too_smallr   r   Fr   r6   c                 a a \        SV4      w  opRpVR8X  d;   \        S VS4      w  rgp\        WxS4      p	\        4       p
\	        Wi,          WR7      pMm\        V\        P                  4      '       dN   \        P                  ! RRV3RV V3R lRVRR	/VP                  4       BR
R/B pVP                  VP                  r\        XX4      # )ah  Compute the xi correlation and perform a test of independence

The xi correlation coefficient is a measure of association between two
variables; the value tends to be close to zero when the variables are
independent and close to 1 when there is a strong association. Unlike
other correlation coefficients, the xi correlation is effective even
when the association is not monotonic.

Parameters
----------
x, y : array-like
    The samples: corresponding observations of the independent and
    dependent variable. The (N-d) arrays must be broadcastable.
axis : int, default: 0
    Axis along which to perform the test.
method : 'asymptotic' or `PermutationMethod` instance, optional
    Selects the method used to calculate the *p*-value.
    Default is 'asymptotic'. The following options are available.

    * ``'asymptotic'``: compares the standardized test statistic
      against the normal distribution.
    * `PermutationMethod` instance. In this case, the p-value
      is computed using `permutation_test` with the provided
      configuration options and other appropriate settings.

y_continuous : bool, default: False
    Whether `y` is assumed to be drawn from a continuous distribution.
    If `y` is drawn from a continuous distribution, results are valid
    whether this is assumed or not, but enabling this assumption will
    result in faster computation and typically produce similar results.

Returns
-------
res : SignificanceResult
    An object containing attributes:

    statistic : float
        The xi correlation statistic.
    pvalue : float
        The associated *p*-value: the probability of a statistic at least as
        high as the observed value under the null hypothesis of independence.

See Also
--------
scipy.stats.pearsonr, scipy.stats.spearmanr, scipy.stats.kendalltau

Notes
-----
There is currently no special handling of ties in `x`; they are broken arbitrarily
by the implementation.

[1]_ notes that the statistic is not symmetric in `x` and `y` *by design*:
"...we may want to understand if :math:`Y` is a function :math:`X`, and not just
if one of the variables is a function of the other." See [1]_ Remark 1.

References
----------
.. [1] Chatterjee, Sourav. "A new coefficient of correlation." Journal of
       the American Statistical Association 116.536 (2021): 2009-2022.
       :doi:`10.1080/01621459.2020.1758115`.

Examples
--------
Generate perfectly correlated data, and observe that the xi correlation is
nearly 1.0.

>>> import numpy as np
>>> from scipy import stats
>>> rng = np.random.default_rng(348932549825235)
>>> x = rng.uniform(0, 10, size=100)
>>> y = np.sin(x)
>>> res = stats.chatterjeexi(x, y)
>>> res.statistic
np.float64(0.9012901290129013)

The probability of observing such a high value of the statistic under the
null hypothesis of independence is very low.

>>> res.pvalue
np.float64(2.2206974648177804e-46)

As noise is introduced, the correlation coefficient decreases.

>>> noise = rng.normal(scale=[[0.1], [0.5], [1]], size=(3, 100))
>>> res = stats.chatterjeexi(x, y + noise, axis=-1)
>>> res.statistic
array([0.79507951, 0.41824182, 0.16651665])

Because the distribution of `y` is continuous, it is valid to pass
``y_continuous=True``. The statistic is identical, and the p-value
(not shown) is only slightly different.

>>> stats.chatterjeexi(x, y + noise, y_continuous=True, axis=-1).statistic
array([0.79507951, 0.41824182, 0.16651665])

greaterr6   )alternativedatar!   c                 ,   < \        SV S4      ^ ,          # )r   )r$   )r   r   r   r   s   &&r#   <lambda>chatterjeexi.<locals>.<lambda>   s    q!\1RST1Ur%   rI   permutation_typepairingsr    r   )r<   r$   r4   r   r   r8   r   r9   permutation_test_asdictr!   r>   r   )r   r   r   r   r   rI   xir   r   stdnormr>   r?   s   f&$d$        r#   r   r   X   s    J ,L&AL&
 K A|4qaL)RXtE	FE33	4	4$$ !U $ 7A EKNNDT 	 ]]CJJFb&))r%   )numpyr   scipyr   scipy.stats._stats_pyr   r   r   scipy.stats._axis_nan_policyr   __all__r$   r4   r<   rA   r   rP   r%   r#   <module>r[      su      P P A 
8&4  % ,TQ*1Q!Mx*q x*u x*\ x*Mx*r%   