+
    Z°³j›w  ã                   ó  € ^ RI t^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
HtHtHtHtHtHt ^ RIHtHtHtHt ^ RIHt ^ RIHtHtHt . R#OtR tR	 tR
 tR t ]
! R$.R7      ]! ]R^] ^^R7      R^ RRRR/R l4       4       t!]
! RR.RR%.RR7      ]! ]R^] ^^R7      RRRRR^ /R l4       4       t"]
! R$R&.RR7      ]! ]R^]R R^R7      R'RR/R ll4       4       t#]
! R$R(.RR7      ]! ]R^]R R^R7      R)RR/R  ll4       4       t$R!R/R" lt%R# )*é    N)ÚstatsÚspecial)Úarray_api_extra)Úxp_capabilitiesÚarray_namespaceÚ
xp_promoteÚis_numpyÚ_share_masksÚ_count_nonmaskedÚ	is_marray)Ú_SimpleNormalÚSignificanceResultÚ_get_pvalueÚ	_rankdata)Ú_axis_nan_policy_factory)ÚTheilslopesResultÚ_n_samples_optional_xÚSiegelslopesResultc           	      óD  € V P                   R,          pVP                  V RR7      pVP                  WQ4      w  rQVP                  WRR7      p\        P
                  ! VRRR7      p\        P
                  ! V) RRR7      pVP                  VP                  VP                  VRR7      4      RR7      pV'       d'   ^^V,          V^,          ^,
          ,          ,
          p	M=^VP                  WG,
          V,          RR7      ,          p
^WH,          V
,          ,
          p	W–V3# )é   ©ÚaxisÚmax)Úmethodr   éÿÿÿÿ)	ÚshapeÚargsortÚbroadcast_arraysÚtake_along_axisr   ÚrankdataÚsumÚabsÚdiff)ÚxÚyÚy_continuousÚxpÚnÚjÚrÚlÚnumÚ	statisticÚdens   &&&&       ÚY/home/luca/screen-checking/.venv/lib/python3.14/site-packages/scipy/stats/_correlation.pyÚ_xi_statisticr0      só   € ð 	
�‰��€Að 	�
‰
�1˜2ˆ
Ó€AØ×Ñ˜qÓ$�D€AØ
×Ñ˜1 bÐÓ)€Aô 	�Š�q ¨RÔ0€Aô 	�Š˜�r %¨bÔ1€Aà
�&‰&�—‘˜Ÿ™ ¨˜Ó+Ó,°2ˆ&Ó
6€CßØ˜˜C� 1¨¥6¨A¥:Õ.Õ.‰	à�"—&‘&˜!�% 1�¨2�&Ó.Õ.ˆØ˜� #�Õ%ˆ	à˜ˆ?Ðó    c                 ó@  € V P                   R,          pV'       dM   VP                  \        P                  ! R4      \        P                  ! V4      ,          V P                  R7      # VP                  ^V^,           V P                  R7      pVP                  V RR7      pVP                  VRR7      p^V^,          ,          VP                  ^V,          ^V,          ,
          ^,           V^,          ,          RR7      ,          p^V^,          ,          VP                  WtV,
          V,          ,           ^,          RR7      ,          p	^V^,          ,          VP                  ^V,          ^V,          ,
          ^,           V,          RR7      ,          p
^V^,          ,          VP                  WV,
          ,          RR7      ,          pV^V	,          ,
          V
^,          ,           V^,          ,          pVP                  V4      \        P                  ! V4      ,          # )r   ©Údtyper   r   gš™™™™™Ù?)	r   ÚasarrayÚmathÚsqrtr4   ÚarangeÚsortÚcumulative_sumr!   )r*   r+   r&   r'   r(   ÚiÚuÚvÚanÚbnÚcnÚdnÚtau2s   &&&&         r/   Ú_xi_stdrC   -   s�  € ð 	
�‰��€A÷ Ø�z‰zœ$Ÿ)š) EÓ*¬T¯YªY°q«\Õ9ÀÇÁˆzÓIÐIð
 	�	‰	�!�Q˜•U !§'¡'ˆ	Ó*€AØ
�‰�˜ˆÓ€AØ
×Ñ˜! "ÐÓ%€AØ	
ˆQ��T��B—F‘F˜A˜a�C ! A¥#�I¨�M¨Q°­TÕ1¸�FÓ;Õ	;€BØ	
ˆQ��T��B—F‘F˜A Q¥¨¥	�M¨AÕ-°B�FÓ7Õ	7€BØ	
ˆQ��T��B—F‘F˜A˜a�C ! A¥#�I¨�M¨QÕ.°R�FÓ8Õ	8€BØ	
ˆQ��T��B—F‘F˜A Q¥�K¨r�FÓ2Õ	2€BØ��2•�I˜˜A�Õ  Q¥Õ&€Dà�7‰7�4‹=œ4Ÿ9š9 Q›<Õ'Ð'r1   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_ivrK   G   sW   € ð ˜=Ô(ÜÐ:Ó;Ð;ä�fœe×5Ñ5×6Ò6Ø—‘“ˆØTˆØ�\Ô!Ü˜WÓ%Ð%àÐÐr1   c                 ó2   € V P                   V P                  3# ©N)r-   Úpvalue)ÚresÚ_s   &&r/   Ú_unpackrQ   W   s   € Ø�=‰=˜#Ÿ*™*Ð$Ð$r1   )Úskip_backendsT)ÚpairedÚ	n_samplesÚresult_to_tupleÚ	n_outputsÚ	too_smallr   r&   Fr   rE   c               óT  a aa€ \        S V4      o\        SV4      w  op\        S VRSR7      w  o pRpVR8X  d@   \        S VSSR7      w  rgp\	        WxSSR7      p	\        4       p
\        Wi,          W¥SR7      pMn\        V\        P                  4      '       dO   \        P                  ! RRV3RV VV3R	 lR
VRR/VP                  4       BRR/B pVP                  VP                  r¶XP                  ^ 8X  d
   VR,          MTpXP                  ^ 8X  d
   VR,          MTp\        Wk4      # )aJ  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.
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.
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.

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]_ recommends: "if there are ties among the Xi's, then
choose an increasing rearrangement as above by breaking ties uniformly at random."
This is easily accomplished by adding a small amount of random noise to `x`; see
examples.

[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])

Consider a case in which there are ties in `x`.

>>> x = rng.integers(10, size=1000)
>>> y = rng.integers(10, size=1000)

[1]_ recommends breaking the ties uniformly at random.

>>> d = rng.uniform(1e-5, size=x.size)
>>> res = stats.chatterjeexi(x + d, y)
>>> res.statistic
-0.029919991638798438

Since this gives a randomized estimate of the statistic, [1]_ also suggests
considering the average over all possibilities of breaking ties. This is
computationally infeasible when there are many ties, but a randomized estimate of
*this* quantity can be obtained by considering many random possibilities of breaking
ties.

>>> d = rng.uniform(1e-5, size=(9999, x.size))
>>> res = stats.chatterjeexi(x + d, y, axis=1)
>>> np.mean(res.statistic)
0.001186895213756626

T©Úforce_floatingr'   ÚgreaterrE   ©r'   )Úalternativer'   Údatar-   c                 ó0   <€ \        SV SSR 7      ^ ,          # )r\   )r0   )r%   r   r$   r'   r&   s   &&€€€r/   Ú<lambda>Úchatterjeexi.<locals>.<lambda>í   s   ø€ ¤m°A°q¸,È2Ô&NÈqÖ&Qr1   r]   Úpermutation_typeÚpairingsr   © r   )r   rK   r   r0   rC   r   r   rG   r   rH   Úpermutation_testÚ_asdictr-   rN   Úndimr   )r$   r%   r   r&   r   r]   Úxir*   r+   ÚstdÚnormrN   rO   r'   s   f&$d$        @r/   Úchatterjeexirk   [   s2  ú€ ôz 
˜˜AÓ	€Bô ,¨L¸&ÓAÑ€L�&Ü�a˜¨4°BÔ7�D€A€qð
 €Kà�ÔÜ   A |¸Ô;‰ˆˆqÜ�a˜L¨RÔ0ˆÜ‹ˆÜ˜R�X tÈÔL‰Ü	�FœE×3Ñ3×	4Ò	4Ü×$Ò$ñ à�ðö Rðð $ð	ð 7Að	ð EKÇNÁNÓDTñ	ð
 òˆð —]‘] C§J¡JˆFà—7‘7˜a”<ˆˆBŽ R€BØ!Ÿ;™;¨!Ô+ˆV�BŽZ°€FÜ˜bÓ)Ð)r1   ú	jax.numpyz:Only the default `method` is compatible with MArray input.)Úcpu_onlyÚ
exceptionsÚmarrayrR   Ú
extra_noter]   z	two-sidedc              ó  € \        W4      p\        WVR7      w  r\        P                  ! WR7      p\        P                  ! WR7      p\        P                  ! WgW2VR7      p\        VP                  VP                  4      # )a'  Calculate a Spearman rho correlation coefficient with associated p-value.

The Spearman rank-order correlation coefficient is a nonparametric measure
of the monotonicity of the relationship between two datasets.
Like other correlation coefficients, it varies between -1 and +1 with 0
implying no correlation. Coefficients of -1 or +1 are associated with an exact
monotonic relationship.  Positive correlations indicate that as `x` increases,
so does `y`; negative correlations indicate that as `x` increases, `y` decreases.
The p-value is the probability of an uncorrelated system producing datasets
with a Spearman correlation at least as extreme as the one computed from the
observed dataset.

Parameters
----------
x, y : array-like
    The samples: corresponding observations of the independent and
    dependent variable. The (N-d) arrays must be broadcastable.
alternative : {'two-sided', 'less', 'greater'}, optional
    Defines the alternative hypothesis. Default is 'two-sided'.
    The following options are available:

    * 'two-sided': the correlation is nonzero
    * 'less': the correlation is negative (less than zero)
    * 'greater':  the correlation is positive (greater than zero)

method : ResamplingMethod, optional
    Defines the method used to compute the p-value. If `method` is an
    instance of `PermutationMethod`/`MonteCarloMethod`, the p-value is
    computed using
    `scipy.stats.permutation_test`/`scipy.stats.monte_carlo_test` with the
    provided configuration options and other appropriate settings.
    Otherwise, the p-value is computed using an asymptotic approximation of
    the null distribution.
axis : int or None, optional
    If axis=0 (default), then each column represents a variable, with
    observations in the rows. If axis=1, the relationship is transposed:
    each row represents a variable, while the columns contain observations.
    If axis=None, then both arrays will be raveled.
    Like other `scipy.stats` functions, `axis` is interpreted after the
    arrays are broadcasted.

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

    statistic : floating point array or NumPy scalar
        Spearman correlation coefficient
    pvalue : floating point array NumPy scalar
        The p-value - the probabilitiy of realizing such an extreme statistic
        value under the null hypothesis that two samples have no ordinal
        correlation. See `alternative` above for alternative hypotheses.

Warns
-----
`~scipy.stats.ConstantInputWarning`
    Raised if an input is a constant array.  The correlation coefficient
    is not defined in this case, so ``np.nan`` is returned.

Notes
-----
`spearmanrho` was created to make improvements to SciPy's implementation of
the Spearman correlation test without making backward-incompatible changes
to `spearmanr`. Advantages of `spearmanrho` over `spearmanr` include:

- `spearmanrho` follows standard array broadcasting rules.
- `spearmanrho` is compatible with some non-NumPy arrays.
- `spearmanrho` can compute exact p-values, even in the presence of ties,
  when an appropriate instance of `PermutationMethod` is provided via the
  `method` argument.

References
----------
.. [1] Zwillinger, D. and Kokoska, S. (2000). CRC Standard
   Probability and Statistics Tables and Formulae. Chapman & Hall: New
   York. 2000.
   Section  14.7
.. [2] Kendall, M. G. and Stuart, A. (1973).
   The Advanced Theory of Statistics, Volume 2: Inference and Relationship.
   Griffin. 1973.
   Section 31.18

Examples
--------
Univariate samples, approximate p-value.

>>> import numpy as np
>>> from scipy import stats
>>> x = [1, 2, 3, 4, 5]
>>> y = [5, 6, 7, 8, 7]
>>> res = stats.spearmanrho(x, y)
>>> res.statistic
np.float64(0.8207826816681233)
>>> res.pvalue
np.float64(0.08858700531354405)

Univariate samples, exact p-value.

>>> res = stats.spearmanrho(x, y, method=stats.PermutationMethod())
>>> res.statistic
np.float64(0.8207826816681233)
>>> res.pvalue
np.float64(0.13333333333333333)

Batch of univariate samples, one vectorized call.

>>> rng = np.random.default_rng(98145152315484)
>>> x2 = rng.standard_normal((2, 100))
>>> y2 = rng.standard_normal((2, 100))
>>> res = stats.spearmanrho(x2, y2, axis=-1)
>>> res.statistic
array([ 0.16585659, -0.12151215])
>>> res.pvalue
array([0.0991155 , 0.22846869])

Bivariate samples using standard broadcasting rules.

>>> res = stats.spearmanrho(x2[np.newaxis, :], x2[:, np.newaxis], axis=-1)
>>> res.statistic
array([[ 1.        , -0.14670267],
       [-0.14670267,  1.        ]])
>>> res.pvalue
array([[0.        , 0.14526128],
       [0.14526128, 0.        ]])

r\   r   )r   r]   r   )r   r
   r   r    Úpearsonrr   r-   rN   )	r$   r%   r]   r   r   r'   ÚrxÚryrO   s	   ""$$$    r/   Úspearmanrhoru   ø   s`   € ôJ 
˜Ó	€BÜ˜ Ô$�D€AÜ	�Š˜Ô	%€BÜ	�Š˜Ô	%€BÜ
�.Š.˜¨ÈdÔ
S€CÜ˜cŸm™m¨S¯Z©ZÓ8Ð8r1   )rR   ro   c                 ó   € \        V 4      # rM   ©Útuple©r$   rP   s   &&r/   r`   r`   Š  ó   € ´u¸Q´xr1   )Údefault_axisrV   rT   rU   rS   rW   c               ó   € \        WW#RR7      # )a  
Computes the Theil-Sen estimator for a set of points (x, y).

`theilslopes` implements a method for robust linear regression.  It
computes the slope as the median of all slopes between paired values.

Parameters
----------
y : array_like
    Dependent variable.
x : array_like or None, optional
    Independent variable. If None, use ``arange(len(y))`` instead.
alpha : float, optional
    Confidence degree between 0 and 1. Default is 95% confidence.
    Note that `alpha` is symmetric around 0.5, i.e. both 0.1 and 0.9 are
    interpreted as "find the 90% confidence interval".
method : {'joint', 'separate'}, optional
    Method to be used for computing estimate for intercept.
    Following methods are supported,

    * 'joint': Uses ``np.median(y - slope * x)`` as intercept.
    * 'separate': Uses ``np.median(y) - slope * np.median(x)``
                  as intercept.

    The default is 'separate'.

    .. versionadded:: 1.8.0

axis : int or tuple of ints, default: None
    If an int or tuple of ints, the axis or axes of the input along which
    to compute the statistic. The statistic of each axis-slice (e.g. row)
    of the input will appear in a corresponding element of the output.
    If ``None``, the input will be raveled before computing the statistic.

Returns
-------
result : ``TheilslopesResult`` instance
    The return value is an object with the following attributes:

    slope : float
        Theil slope.
    intercept : float
        Intercept of the Theil line.
    low_slope : float
        Lower bound of the confidence interval on `slope`.
    high_slope : float
        Upper bound of the confidence interval on `slope`.

See Also
--------
siegelslopes : a similar technique using repeated medians

Notes
-----
The implementation of `theilslopes` follows [1]_. The intercept is
not defined in [1]_, and here it is defined as ``median(y) -
slope*median(x)``, which is given in [3]_. Other definitions of
the intercept exist in the literature such as  ``median(y - slope*x)``
in [4]_. The approach to compute the intercept can be determined by the
parameter ``method``. A confidence interval for the intercept is not
given as this question is not addressed in [1]_.

For compatibility with older versions of SciPy, the return value acts
like a ``namedtuple`` of length 4, with fields ``slope``, ``intercept``,
``low_slope``, and ``high_slope``, so one can continue to write::

    slope, intercept, low_slope, high_slope = theilslopes(y, x)

References
----------
.. [1] P.K. Sen, "Estimates of the regression coefficient based on
       Kendall's tau", J. Am. Stat. Assoc., Vol. 63, pp. 1379-1389, 1968.
.. [2] H. Theil, "A rank-invariant method of linear and polynomial
       regression analysis I, II and III",  Nederl. Akad. Wetensch., Proc.
       53:, pp. 386-392, pp. 521-525, pp. 1397-1412, 1950.
.. [3] W.L. Conover, "Practical nonparametric statistics", 2nd ed.,
       John Wiley and Sons, New York, pp. 493.
.. [4] https://en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator

Examples
--------
>>> import numpy as np
>>> from scipy import stats
>>> import matplotlib.pyplot as plt

>>> x = np.linspace(-5, 5, num=150)
>>> y = x + np.random.normal(size=x.size)
>>> y[11:15] += 10  # add outliers
>>> y[-5:] -= 7

Compute the slope, intercept and 90% confidence interval.  For comparison,
also compute the least-squares fit with `linregress`:

>>> res = stats.theilslopes(y, x, 0.90, method='separate')
>>> lsq_res = stats.linregress(x, y)

Plot the results. The Theil-Sen regression line is shown in red, with the
dashed red lines illustrating the confidence interval of the slope (note
that the dashed red lines are not the confidence interval of the regression
as the confidence interval of the intercept is not included). The green
line shows the least-squares fit for comparison.

>>> fig = plt.figure()
>>> ax = fig.add_subplot(111)
>>> ax.plot(x, y, 'b.')
>>> ax.plot(x, res[1] + res[0] * x, 'r-')
>>> ax.plot(x, res[1] + res[2] * x, 'r--')
>>> ax.plot(x, res[1] + res[3] * x, 'r--')
>>> ax.plot(x, lsq_res[1] + lsq_res[0] * x, 'g-')
>>> plt.show()

Útheilslopes)r$   Úalphar   Úpfun©Ú_robust_slopes)r%   r$   r~   r   r   s   &&&&$r/   r}   r}   …  s   € ôp ˜!¨À=ÔQÐQr1   c                 ó   € \        V 4      # rM   rw   ry   s   &&r/   r`   r`     rz   r1   c               ó   € \        WVRR7      # )a¬  
Computes the Siegel estimator for a set of points (x, y).

`siegelslopes` implements a method for robust linear regression
using repeated medians (see [1]_) to fit a line to the points (x, y).
The method is robust to outliers with an asymptotic breakdown point
of 50%.

Parameters
----------
y : array_like
    Dependent variable.
x : array_like or None, optional
    Independent variable. If None, use ``arange(len(y))`` instead.
method : {'hierarchical', 'separate'}
    If 'hierarchical', estimate the intercept using the estimated
    slope ``slope`` (default option).
    If 'separate', estimate the intercept independent of the estimated
    slope. See Notes for details.
axis : int or tuple of ints, default: None
    If an int or tuple of ints, the axis or axes of the input along which
    to compute the statistic. The statistic of each axis-slice (e.g. row)
    of the input will appear in a corresponding element of the output.
    If ``None``, the input will be raveled before computing the statistic.

Returns
-------
result : ``SiegelslopesResult`` instance
    The return value is an object with the following attributes:

    slope : float
        Estimate of the slope of the regression line.
    intercept : float
        Estimate of the intercept of the regression line.

See Also
--------
theilslopes : a similar technique without repeated medians

Notes
-----
With ``n = len(y)``, compute ``m_j`` as the median of
the slopes of the lines from the point ``(x[j], y[j])`` to all other ``n-1`` points.
``slope`` is then the median of all slopes ``m_j``.
Two ways are given to estimate the intercept in [1]_ which can be chosen
via the parameter ``method``.
The hierarchical approach uses the estimated slope ``slope``
and computes ``intercept`` as the median of ``y - slope*x``.
The other approach estimates the intercept separately as follows: for
each point ``(x[j], y[j])``, compute the intercepts of all the ``n-1``
lines through the remaining points and take the median ``i_j``.
``intercept`` is the median of the ``i_j``.

The implementation computes `n` times the median of a vector of size `n`
which can be slow for large vectors. There are more efficient algorithms
(see [2]_) which are not implemented here.

For compatibility with older versions of SciPy, the return value acts
like a ``namedtuple`` of length 2, with fields ``slope`` and
``intercept``, so one can continue to write::

    slope, intercept = siegelslopes(y, x)

References
----------
.. [1] A. Siegel, "Robust Regression Using Repeated Medians",
       Biometrika, Vol. 69, pp. 242-244, 1982.

.. [2] A. Stein and M. Werman, "Finding the repeated median regression
       line", Proceedings of the Third Annual ACM-SIAM Symposium on
       Discrete Algorithms, pp. 409-413, 1992.

Examples
--------
>>> import numpy as np
>>> from scipy import stats
>>> import matplotlib.pyplot as plt

>>> x = np.linspace(-5, 5, num=150)
>>> y = x + np.random.normal(size=x.size)
>>> y[11:15] += 10  # add outliers
>>> y[-5:] -= 7

Compute the slope and intercept.  For comparison, also compute the
least-squares fit with `linregress`:

>>> res = stats.siegelslopes(y, x)
>>> lsq_res = stats.linregress(x, y)

Plot the results. The Siegel regression line is shown in red. The green
line shows the least-squares fit for comparison.

>>> fig = plt.figure()
>>> ax = fig.add_subplot(111)
>>> ax.plot(x, y, 'b.')
>>> ax.plot(x, res[1] + res[0] * x, 'r-')
>>> ax.plot(x, lsq_res[1] + lsq_res[0] * x, 'g-')
>>> plt.show()

Úsiegelslopes)r$   r   r   r€   )r%   r$   r   r   s   &&&$r/   r„   r„      s   € ôX ˜!¨°nÔEÐEr1   r~   c          	      ón  a!€ VR 8X  d   RMRpW5R09  d   \        RV RV R24      h\        W4      o!\        WRS!R7      w  rVf/   S!P                  V P                  R,          V P
                  R
7      MTpS!P                  W4      w  r\        WS!R7      w  rVP                  R,          ^8  g   V P                  R,          ^8  d   \        R4      hVRRS!P                  3,          VRS!P                  R3,          ,
          pV RRS!P                  3,          V RS!P                  R3,          ,
          pVR 8X  dã   S!P                  S!P                  S!P                  VP                  R R	 4      ^R7      S!P                  4      p\        S!4      '       d   VRV3,          VRV3,          rvMrS!P                  W†P                  4      pWh,          Wx,          rvS!P                  V. VP                  R	R  ORN54      pS!P                  V. VP                  R	R  ORN54      p\!        S!4      '       d   VP"                  ^ 8H  MV^ 8H  p	\$        P&                  ! V4      V	,          P)                  S!P*                  4      pWv,          p
\!        S!4      '       d   V!3R lpMR pR pVR8X  d   V! V! V
RR7      RR7      M	V! V
RR7      pVR!9   d0   V! WR\,        P                  3,          V,          ,
          RR7      pMpVR 8X  d!   V! V RR7      WÜ! VRR7      ,          ,
          pMIV RRS!P                  3,          W¡RRS!P                  3,          ,          ,
          pV! V! VRR7      RR7      pVR8X  d   \/        VR",          VR",          R7      # VR8”  d
   RV,
          p\1        \2        P4                  ! VR,          4      4      p\7        VRRR7      w   pp\7        V RRR7      w   ppS!P9                  S!P;                  V
4      RRR7      pS!P=                  VV P
                  R
7      p\?        V RRR7      pR#VV^,
          ,          ^V,          ^,           ,          S!PA                  VV^,
          ,          ^V,          ^,           ,          RRR7      ,
          S!PA                  VV^,
          ,          ^V,          ^,           ,          RRR7      ,
          ,          pS!PC                  S!PE                  VS!PG                  V4      4      4      pS!PI                  S!P                  S!PK                  VVV,          ,
          R,          4      S!PL                  4      S!P                  VS!PL                  4      ^,
          4      pS!PE                  S!P                  S!PK                  VVV,          ,           R,          4      S!PL                  4      ^,
          S!P=                  ^ S!PL                  R
7      4      pS!PO                  \$        PP                  ! V^R7      \$        PP                  ! V^R7      3RR7      pS!PS                  V
RR7      p
S!PU                  V
VRR7      pS!P                  V^ 8  VP                  4      p\$        P&                  ! V4      V,          P)                  S!P*                  4      pVPV                  ^ 8X  d
   VR",          MTpVPV                  ^ 8X  d
   VR",          MTpVR$,          pVR%,          p VPV                  ^ 8X  d
   VR",          MTpV PV                  ^ 8X  d
   V R",          MT p \Y        VVVV R7      # )&r}   ÚjointÚhierarchicalÚseparatezmethod must be either 'z' or 'separate'. 'z' is invalid.TrY   Nr3   r\   z(`x` and `y` must have length at least 2..:NNN)Úkc                 óØ   <€ SP                  V P                  V P                  V P                  P	                  V P                  4      ,          R 7      p\
        P                  ! VRVR7      # ))Úmaskç      à?r   )r5   r^   r‹   Ú_xpÚisnanr   Úquantile)r$   r   Úx_nans_maskedr'   s   && €r/   Ú	nanmedianÚ!_robust_slopes.<locals>.nanmedian•  sF   ø€ ØŸJ™J q§v¡v°A·F±F¸Q¿U¹U¿[¹[ÈÏÉÓ=PÕ4P˜JÓQˆMÜ—>’> -°¸4Ô@Ð@r1   c                 ó6   € \         P                  ! V R VRR7      # )rŒ   Úomit)r   Ú
nan_policy©r   r�   ©r$   r   s   &&r/   r‘   r’   ™  s   € Ü—>’> ! S¨tÀÔGÐGr1   c                 ó4   € \         P                  ! V R VR7      # )rŒ   r   r–   r—   s   &&r/   ÚmedianÚ_robust_slopes.<locals>.medianœ  s   € ¤§¢¨q°#¸DÔ AÐAr1   r„   r   )ÚslopeÚ	interceptrŒ   g      ð?g       @Úmin)r   Úreturn_ties)r   Úkeepdims)rŸ   r   )rg   )r›   rœ   Ú	low_slopeÚ
high_sloper   éþÿÿÿ>   r†   r‡   rd   gÇqÇq¬?).r   ).r   )-rF   r   r   r8   r   r4   r   r
   ÚnewaxisÚastypeÚtriuÚonesÚboolr	   Úbroadcast_toÚreshaper   r^   ÚxpxÚatÚsetÚnanÚnpr   Úfloatr   Úndtrir   Úcount_nonzeroÚisfiniter5   r   r!   r7   ÚmaximumÚ
zeros_likeÚminimumÚroundÚint64ÚconcatÚ
atleast_ndr9   r   rg   r   )"r%   r$   r~   r   r   Úother_methodÚdeltaxÚdeltayr;   Údeltax0Úslopesr‘   r™   ÚmedslopeÚmedinterÚ
interceptsÚzrP   ÚnxrepsÚnyrepsÚntÚnyÚsigsqÚsigmaÚRuÚRlÚRÚdeltaÚi_nanr›   rœ   r    r¡   r'   s"   &$$$$                            @r/   r�   r�   o  s	  ø€ Ø" mÔ3‘7¸€LØ JÐ/Ô/ÜÐ2°<°.ð AØ#˜H Mð3ó 4ð 	4ô 
˜Ó	€BÜ�a¨4°BÔ7�D€AØ12²ˆ�	‰	�!—'‘'˜"•+ Q§W¡Wˆ	Ô-À€AØ×Ñ˜qÓ$�D€AÜ˜ Ô$�D€Aà‡w�wˆr…{�Q„˜!Ÿ'™' "�+¨œ/ÜÐCÓDÐDð ˆs�A�r—z‘zÐ!Õ" Q s¨B¯J©J¸Ð'9Õ%:Õ:€FØˆs�A�r—z‘zÐ!Õ" Q s¨B¯J©J¸Ð'9Õ%:Õ:€Fàˆ}ÔØ�I‰I�b—g‘g˜bŸg™g f§l¡l°2°3Ð&7Ó8¸A�gÓ>ÀÇÁÓHˆÜ�B�<Š<Ø# C¨ F�^¨V°C¸°F­^‘Fð —‘ §<¡<Ó0ˆAØ#�Y¨­	�FØ—Z‘Z Ð(;¨!¯'©'°#°2¨,Ð(;¸Ñ(;Ó<ˆFØ—Z‘Z Ð(;¨!¯'©'°#°2¨,Ð(;¸Ñ(;Ó<ˆFô %.¨b§M¢Mˆv�{‰{˜aÒ¸À!¹€GÜ�VŠV�F‹^˜GÕ$×(Ñ(¨¯©Ó0€FØ�_€Fä�‡}‚}ö	Aò	Hò Bð @DÀ~Ô?U‘‘y ¨bÔ1¸Õ;Ù˜v¨BÔ/ð ð Ð*Ô*Ù˜! s¬B¯J©J Õ7¸!Õ;Õ;À"ÔE‰Ø	�Ô	Ù˜! "Ô%¨°6¸!À"Ô3EÕ(EÕE‰ð �s˜A˜rŸz™zÐ)Õ*¨V°c¸1¸b¿j¹jÐ6HÕ4IÕ-IÕIˆ
Ù™) J°RÔ8¸rÔBˆàˆ~ÔÜ!¨°­ÀÈÅÔMÐMð ˆs„{Ø�U•
ˆäŒg�mŠm˜E B�JÓ'Ó(€Aô
 ˜Q u¸$Ô?�L€A€qˆ&Ü˜Q u¸$Ô?�L€A€qˆ&Ø	×	Ñ	˜"Ÿ+™+ fÓ-°BÀÐ	Ó	F€BØ	�‰�B˜aŸg™gˆÓ	&€BÜ	˜! d°Ô	4€BàØ
ˆb��d��q˜•t˜A•vÕØ
�&‰&�˜6 !�8Õ$¨¨&­°1­Õ5¸BÈˆ&Ó
Nõ	Oà
�&‰&�˜6 !�8Õ$¨¨&­°1­Õ5¸BÈˆ&Ó
Nõ	OõP€Eð
 �G‰G�B—J‘J˜u b§m¡m°EÓ&:Ó;Ó<€EØ	�‰�B—I‘I˜bŸh™h¨¨Q¨u­W­°bÕ'8Ó9¸2¿8¹8ÓDØ—I‘I˜b "§(¡(Ó+¨AÕ-ó
/€Bà	�‰�B—I‘I˜bŸh™h¨¨Q¨u­W­°bÕ'8Ó9¸2¿8¹8ÓDÀqÕHØ—J‘J˜q¨¯©�JÓ1ó
3€Bà
�	‰	”3—>’> "¨1Ô-¬s¯~ª~¸bÀqÔ/IÐJÐQSˆ	ÓT€AØ�W‰W�V "ˆWÓ%€FØ×Ñ˜v q¨rÐÓ2€EØ�O‰O˜E A™I u§{¡{Ó3€EÜ�FŠF�5‹M˜%Õ ×$Ñ$ R§V¡VÓ,€Eà$ŸM™M¨QÔ.ˆH�RŽL°H€EØ (§¡°Ô 2�˜–¸€IØ�f•€IØ�v•€JØ!*§¡°1Ô!4�	˜"–¸)€IØ#-§?¡?°aÔ#7�˜B–¸Z€JÜ 5°IØ'0¸ZôIð Ir1   )rk   ru   r}   r„   )ú
dask.arrayzno take_along_axis)rÎ   z+not supported by rankdata (take_along_axis))rl   znon-concrete boolean indexing)Ngffffffî?rˆ   )rl   zquantile needs lazy nan_policy)Nr‡   )&Únumpyr®   r6   Úscipyr   r   Úscipy._externalr   rª   Úscipy._lib._array_apir   r   r   r	   r
   r   r   Úscipy.stats._stats_pyr   r   r   r   Úscipy.stats._axis_nan_policyr   Ú scipy.stats._stats_mstats_commonr   r   r   Ú__all__r0   rC   rK   rQ   rk   ru   r}   r„   r�   rd   r1   r/   Ú<module>r×      sÐ  ðÛ Û ß  Ý 2÷X÷ Xñ X÷.ó .å A÷Bñ Bò I€òò8(ò4 ò %ñ Ð DÐEÔFÙÐ,°TÀQØ*1¸QÈ!ôMðW*˜qð W*¨uð W*¸\ó W*óMó GðW*ñt ˜$¨K¨=ÀØPÐQØKôñ Ð,°TÀQØ*1¸QÈ!ôMðD9¨ð D9¸Dð D9Àqó D9óMó	ðD9ñN Ð DØ Nð Pàôñ Ð+¸$È!Ø$9Ù*?ÈØ$%ô'ñqRÀ$ô qRó	'óðqRñh Ð DØ Oð Qàôñ Ð,¸4È1Ø$9Ù*?ÈØ$%ô'ñeF¸4ô eFó	'óðeFðPlI $ö lIr1   