+
    nDjA                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIHtHtH	t	 ^ RIH
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 ^ R	IHt ^ R
IH t! ^ RI"H#t#H$t$H%t%H&t&H't'H(t( ^ RI)H*t*H+t+ ^ RI,H-t-H.t. ].t/]P`                  Pb                  t1]#! ]4       ! R R4      4       t2]#! ]P&                  4       ! R R4      4       t3]#! ]P4                  4       ! R R4      4       t4 ! R R]4      t5 ! R R4      t6 ! R R4      t7]#! ]4       ! R R4      4       t8 ! R R4      t9 ! R R4      t: ! R  R!4      t;]#! ]Px                  4       ! R" R#4      4       t=R# )$    )productN)assert_assert_equalassert_allclose)raises)statsspecial)distributions)epps_singleton_2sampcramervonmises_cdf_cvmcramervonmises_2samp_pval_cvm_2samp_exactbarnard_exactboschloo_exact)mannwhitneyu
_mwu_state_MWU)_TestPythranFunc)array_api_extra)make_xp_test_casexp_default_dtypeis_numpyeager_warnsxp_ravelis_jax)xp_assert_equalxp_assert_close)SmallSampleWarningtoo_small_1d_not_omitc                      a  ] tR t^t o R t]P                  P                  R. R
O4      R 4       tR t	R t
R tR tR	tV tR# )TestEppsSingletonc                   VP                  . RO4      pVP                  . RO4      pVP                  RR.4      p\        V4      '       dZ   \        W#VR7      w  rV\        WQP                  VP                  4      4       \        WaP                  VP                  4      4       R# Rp\
        P                  ! \        VR7      ;_uu_ 4        \        W#VR7       RRR4       R#   + '       g   i     R# ; i)	ffffff?皙?)tz&t must contain positive elements only.matchN)ffffffֿffffff@Gz?\(\?r$   )ffffff333333ÿףp=
@      
@Gz@gٿ)asarrayr   r   r   nanpytestr   
ValueError)selfxpxyr&   wpmessages   &&      Z/data/cameron/venvs/s3viz/lib/python3.14/site-packages/scipy/stats/tests/test_hypotests.pytest_epps_singleton_iv(TestEppsSingleton.test_epps_singleton_iv   s     JJ67JJ78JJT{#"::'2DAAzz"&&12Azz"&&12>Gz99$QQ/ :999s   
C""C3	dtypeNc                    Vf   \        V4      M
\        W!4      pVP                  . ROVR7      pVP                  . ROVR7      p\        W44      w  rV\	        WRP                  RVR7      RR7       \	        WbP                  RVR7      RR7       R # )	Nr@   gHzG.@gQ?atolgQ,r?-C6?)
r)   r*   r+   r,   r$   gQ@gq=
ףp?gGzgGz׿gp=
#(@)
r-   r.   r/   r0   r1   g)\(@      @g(\@g(\ @333333!@)r   getattrr2   r   r   )r6   r@   r7   r8   r9   r:   r;   s   &&&    r=   test_statistic_1"TestEppsSingleton.test_statistic_1,   s     ). $72;MJJ 9@E  GJJ 3:?  A#A)::e5:9E::gU:;&I    c                    VP                  . RO4      pVP                  . RO4      p\        W#4      w  rE\        WAP                  R4      RR7       \        WQP                  R4      RR7       R# )	r   g!@MbP?rC   g&J?g-C6
?N)r         rO   rO   rO      rP   rP   rP         rR   rR   rR      
   rT   rT   rT   )rT   rQ   r   rR   rT   rT   r   rR   rS      rT   rP   rN   rU   r      rN   rR   rV   rT   )r2   r   r   )r6   r7   r8   r9   r:   r;   s   &&    r=   test_statistic_2"TestEppsSingleton.test_statistic_2;   sZ    JJ 7 8JJ 8 9#A)::e,48::g.T:rK   c                z   \         P                  ! ^4      \         P                  ! ^4      r!\        \        V4      \        V4      4      w  r4\        \	        V4      \	        V4      4      w  rV\        W4      w  rx\        Y5u;8H  ;'       d    V8H  Mu 4       \        YFu;8H  ;'       d    V8H  4       R# u 4       R# )   N)nparanger   listtupler   )	r6   r8   r9   w1p1w2p2w3p3s	   &        r=   test_epps_singleton_array_like0TestEppsSingleton.test_epps_singleton_array_likeE   sv    yy}biim1%d1gtAw7%eAha9%a+BBrK   c                   VP                  . RO4      VP                  ^
4      r2\        \        \        VR7      ;_uu_ 4        \        W#4      p\        VP                  VP                  VP                  4      4       \        VP                  VP                  VP                  4      4       RRR4       R#   + '       g   i     R# ; i)rN   r(   r7   NrN   rO   rP   rQ   )
r2   r\   r   r   r    r   r   	statisticr3   pvalue)r6   r7   r8   r9   ress   &&   r=   test_epps_singleton_size*TestEppsSingleton.test_epps_singleton_sizeO   s{    zz,'21+3HRPP&q,CCMM2::bff+=>CJJ

266(:; QPPPs   A*B66C	c                   \         P                  P                  R 4      pVP                  RR7      pVP                  RR7      p\         P                  ! . RO4      p\	        W4RR7      w  rg\         P
                  We&   \         P
                  Wu&   \         P
                  W5^ ,          ^ 3&   \         P                  W5^,          ^3&   \         P                  ) WE^,          ^3&   VP                  V4      VP                  V4      rC\	        W4RR7      w  r\        WP                  V4      4       \        WP                  V4      4       R# )l   2$>. sizeaxisN)rT      )rT      )rN   rQ   	   )r[   randomdefault_rngr2   r   r3   infr   )
r6   r7   rngr8   r9   iw_refp_refw_resp_ress
   &&        r=   test_epps_singleton_nonfinite/TestEppsSingleton.test_epps_singleton_nonfiniteW   s    ii##N3JJHJ%JJHJ%JJy!+Ar:6666VVA$'
VVA$'
ffWA$'
zz!}bjjm1+Ar:zz%01zz%01rK    Nfloat32float64)__name__
__module____qualname____firstlineno__r>   r4   markparametrizerI   rW   re   rm   r   __static_attributes____classdictcell____classdict__s   @r=   r"   r"      sL     0 [[W&BCJ DJ; <2 2rK   r"   c            
       T  a  ] tR t^kt o ]P
                  P                  R^. RO. RO3^
. RO. RO3R. RO. RO3R. RO. RO3.4      R 4       tR tR t	R t
R t]P
                  P                  R	RR
..4      R 4       t]P
                  P                  R. RO4      R 4       tR tRtV tR# )TestCvmz	n, x, ref  Nc                r    \        \        VP                  V4      V4      VP                  V4      R R7       R# rE   rC   N)r   r   r2   )r6   nr8   refr7   s   &&&&&r=   test_cdf_refTestCvm.test_cdf_refp   s'     	A2BJJsO$OrK   c                    \        \        VP                  RR.4      R4      VP                  RR.4      4       \        \        VP                  RR.4      ^4      VP                  RR.4      4       R# )	rN   i                ?NgX(~$?gUUUUU5f@gaah?g"@)r   r   r2   )r6   r7   s   &&r=   test_cdf_supportTestCvm.test_cdf_supporty   s`    Z,?!@#F

B8,	._j,I!JBO

B8,	.rK   c                n    VP                  . RO4      p\        \        VR4      \        V4      RR7       R# )a+e?'  rE   rC   N)r   +?&pn?+MJA?d   )r2   r   r   r6   r7   r8   s   && r=   test_cdf_large_nTestCvm.test_cdf_large_n   s(    JJ@AE*HQKdCrK   c                    VP                  R VP                  R7      pR\        VR4      u;8  d	   R8  g   Q h Q hR\        V4      u;8  d	   R8  g   Q h Q hR# )gt@rB   gwJ?r   r   N)r2   r   r   r   s   && r=   test_large_xTestCvm.test_large_x   sW     JJuBJJJ/(1d+1c12121(1+++,+,+rK   c                    ^p\        VP                  V4      R,          \        P                  4      p\	        VP
                  W!R7      R8  g   Q h\        VP                  VP                  R4      4       R# )ru   皙?)r7   r   r   N)	r   onesr	   ndtrr   rj   r   rk   r2   )r6   r7   r   rl   s   &&  r=   
test_low_pTestCvm.test_low_p   sT     RWWQZ^W\\:q03666

BJJrN3rK   r8         ?c                   \         P                  ! \        \        R 7      ;_uu_ 4        \	        VP                  V4      \        P                  4      p\        VP                  VP                  VP                  4      4       \        VP                  VP                  VP                  4      4       RRR4       R#   + '       g   i     R# ; i)r'   N)r4   warnsr   r    r   r2   r	   r   r   rj   r3   rk   )r6   r8   r7   rl   s   &&& r=   test_invalid_inputTestCvm.test_invalid_input   ss    \\,4IJJ A=CCMM2::bff+=>CJJ

266(:; KJJJs   BB;;C	r@   c                  a Vf   \        S4      M\        SV4      p\        SP                  . R
OVR7      \        P
                  4      p\        VP                  SP                  RVR7      4       \        VP                  SP                  RVR7      4       \        SP                  . R
OVR7      R 4      p\        VP                  SP                  RVR7      4       \        VP                  SP                  RVR7      4       \        SP                  . ROVR7      V3R l4      p\        VP                  SP                  RVR7      4       \        VP                  SP                  R	VR7      4       R # )NrB   gӈk&q?gDC+?c                 J    \         P                  ! V ^,
          R,          4      # )rP   r   )r	   r   )r8   s   &r=   <lambda>'TestCvm.test_values_R.<locals>.<lambda>   s    w||QUCK'@rK   grW*?gju2`?c                 *   < SP                  V ) 4      ) # N)expm1)r8   r7   s   &r=   r   r      s    rxx|mrK   g  .?g`(r?)g333333rO   r   g?rQ   皙?333333?)	rN   rO   rR   ffffff?gQ?rt      ?      @)	r   rH   r   r2   r	   r   r   rj   rk   )r6   r@   r7   rl   s   &&f r=   test_values_RTestCvm.test_values_R   s'   (- $72u;M
 RZZ(FeZT$\\+rzz2B%z'PQ

BJJuJ$MN RZZ(FeZT@Brzz2B%z'PQ

BJJ/@J$NO JJ=UJK#% 	rzz2B%z'PQ

BJJ/@J$NOrK   c                   \        V4      '       gO   R p\        P                  ! \        VR7      ;_uu_ 4        \	        VP                  . RO4      R4       RRR4       R# \        P                  ! ^4      RrC\	        V\        P                  P                  4      p\	        VR4      p\        VP                  VP                  3VP                  VP                  34       \	        V\        P                  P                  V4      p\	        VRV4      p\        VP                  VP                  3VP                  VP                  34       R#   + '       g   i     R# ; i)z7`cdf` must be a callable if `rvs` is a non-NumPy array.r'   betaNexponrN   rO   rP   )r   ffffff?)r   r4   r   r5   r   r2   r[   r\   r
   r   cdfr   rj   rk   r   )r6   r7   r<   r8   argsr   rl   s   &&     r=   test_str_cdfTestCvm.test_str_cdf   s    ||OGz99rzz)4f= :))A,
4Q 3 3 7 78Q(cmmSZZ03==#**2MNQ 2 2 6 6=Q-cmmSZZ03==#**2MN :9s   EE	r   )gy;i?g#^?gE>?gD
)?){Gz?皙?      ?g+?)g8*5?g@߾?gHm?g%1 ?)r   r   r   g333333?)g}tg?g`?gI5o?gׁsF?)r   r   r   r   r   )r   r   r   r   r4   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r=   r   r   k   s     
 [[[	
02JK	13KL	35MN	35MN	+ PP.D
-4 [[S2u+.< /< [[W&BCP DP0O OrK   r   c                     a  ] tR t^t o R tR tR tR t. R8Ot. R9Ot	RRRR/R:.RR
RR/R;.RRRR/R<.RRRR/R=.RR
RR/R>.RRRR/R?..t
]P                  P                  R@]
4      ]P                  P                  R. RAO4      R 4       4       tRRRR/RB.RR
RR/RC.RRRR/RD.RRRR/RE.RR
RR/RF.RRRR/RG..t]P                  P                  R@]4      R 4       tR t^. RHO^. RIO^. RJO/t^. RKO^. RLO^. RMO^. RNO/t^. ROO^. RPO^. RQO^. RRO^. RSO/t^. RTO^. RUO^. RVO^. RWO^. RXO^. RYO/tR tR tR tRRRR/RZ.RR
RR/R[.RRRR/R\.RRRR/R].RR
RR/R[.RRRR/R]..t]P                  P                  R^]4      R 4       tR t]P                  P                  RRR.4      R 4       tR t]! RRR7      R 4       t. R_O^^^^] PB                  ^^^^^^.R R!3. R_O^^^^] PB                  ] PB                  ^^^^^.R"R#3^^] PB                  ^.^^^^] PB                  ^^^^^^.R$R%3^^] PB                  ^.^^^^] PB                  ] PB                  ^^^^^.R	R&3^] PB                  ] PB                  ^.^^^^] PB                  ] PB                  ^^^^^.R'R(3.t"]P                  P                  R`]"4      R) 4       t#. RaO. RbO. RcO. RdO. ReO. RfO. RgO. RhO. RiO.	t$]P                  P                  Rj]$4      R* 4       t%]! RRR7      R+ 4       t&. RkOR,R-.RRl.. RkOR,R-.R
Rl.. RkOR,R-.RRm.. RnO^.RRo.. RnO^.R
Ro.. RnO^.RRp.^^.^^.RRq.^^.^^.R
Rq.^^.^^.RRr..	t']P                  P                  . RsO]'4      R. 4       t(R/ t)]P                  P                  R. RtO4      R0 4       t*. RuOt+. RvOt,R1t-R2 t.R3 t/R4 t0R5 t1R6 t2R7t3V t4R# )wTestMannWhitneyUc                "   VR 8X  d   \         P                  ! V4      pV# VR8X  d   \         P                  ! V4      ) pV# W#V,          ^,          8  d   \         P                  ! V^,          4      M\         P                  ! V^,          4      ) pV# lessgreater)r	   ndtri)r6   r;   Un1n2alternativezs   &&&&&& r=   get_zstatistic_from_pvalue+TestMannWhitneyU.get_zstatistic_from_pvalue   sx    & a A
 	 I%q!!A  '(R%'kac"ac8J7JArK   c                   VP                  ^^.4      pVP                  ^^.4      pVP                  . VP                  R7      pVP                  VP                  4      p\        P                  ! \
        \        R7      ;_uu_ 4        \        W$4      p\        VP                  V4       \        VP                  V4       RRR4       \        P                  ! \
        \        R7      ;_uu_ 4        \        WC4      p\        VP                  V4       \        VP                  V4       RRR4       \        P                  ! \
        \        R7      ;_uu_ 4        \        WD4      p\        VP                  V4       \        VP                  V4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)rN   rB   r'   N)r2   r@   r3   r4   r   r   r    r   r   rj   rk   )r6   r7   r8   r9   emptyr3   rl   s   &&     r=   
test_emptyTestMannWhitneyU.test_empty   s3   JJ1vJJ1v

2QWW
-jj \\,4IJJq(CCMM3/CJJ, K
 \\,4IJJu(CCMM3/CJJ, K
 \\,4IJJu,CCMM3/CJJ, KJ KJ
 KJ
 KJJs$   8F/8F,8F?F)	,F<	?G	c                d   VP                  ^^.4      pVP                  ^^.4      p\        \        RR7      ;_uu_ 4        \        W#RR7       RRR4       \        \        RR7      ;_uu_ 4        \        W#RR7       RRR4       \        \        RR7      ;_uu_ 4        \        W#R	R
7       RRR4       \        \        RR7      ;_uu_ 4        \        W#RR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lg; i  + '       g   i     R# ; i)rN   z`use_continuity` must be oner'   ekki)use_continuityNz`alternative` must be one ofr   z`axis` must be an integerr   rr   z`method` must be one ofmethod)r2   assert_raisesr5   r   )r6   r7   r8   r9   s   &&  r=   test_input_validation&TestMannWhitneyU.test_input_validation   s    JJ1vJJ1v:-KLLf5 M:-KLL62 M:-HIIC( J:-FGGf- HG MLLLIIGGGs0    C%/C8DD%C5	8D	D	D/	c                   \        V4      '       d\   R p\        P                  ! \        VR7      ;_uu_ 4        \	        VP                  ^
4      VP                  ^
4      4       RRR4       R# \        P                  P                  R4      p^pVP                  VP                  V^,
          4      4      pVP                  VP                  V^,
          4      4      p\	        WV4      p\	        WVRR7      p\	        WVRR7      p	VP                  V	P                  8X  g   Q hVP                  VP                  8w  g   Q hVP                  VP                  V^,
          4      4      pVP                  VP                  V^,           4      4      p\	        WV4      p\	        WVRR7      p\	        WVRR7      p	VP                  V	P                  8X  g   Q hVP                  VP                  8w  g   Q h\	        We4      p\	        WVRR7      p\	        WVRR7      p	VP                  V	P                  8X  g   Q hVP                  VP                  8w  g   Q hVP                  VP                  V^,           4      4      pVP                  VP                  V^,           4      4      p\	        WV4      p\	        WVRR7      p\	        WVRR7      p	VP                  V	P                  8w  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  V^,
          4      4      pVP                  VP                  V^,
          4      4      p\        P                  ! V4      ^,          P                  V^,          4      p\	        WV4      p\	        WVRR7      p\	        WVRR7      p	VP                  V	P                  8w  g   Q hVP                  VP                  8X  g   Q hR#   + '       g   i     R# ; i)z0`method='auto'` is incompatible with JAX arrays.r'   Nl   nEQWSf
asymptoticr   exact)r   r4   r   r5   r   r\   r[   rx   ry   r2   rk   xpxatset)
r6   r7   r<   r{   r   r8   r9   autor   r   s
   &&        r=   	test_autoTestMannWhitneyU.test_auto   s   "::HGz99RYYr]BIIbM: :ii##$67 JJszz!A#'JJszz!A#'A!!!|<
Q'2{{ell***{{j///// JJszz!A#'JJszz!A#'A!!!|<
Q'2{{ell***{{j///// A!!!|<
Q'2{{ell***{{j///// JJszz!A#'JJszz!A#'A!!!|<
Q'2{{ell***{{j///// JJszz!A#'JJszz!A#'FF1IaLQqT"A!!!|<
Q'2{{ell***{{j/////e :9s   +OO'	r   	two-sidedr   r         0@r   r   r   r@   Nc                   Vf   \        V4      M
\        WC4      pVP                  V P                  VR7      VP                  V P                  VR7      re\        WV3/ VB p\        VP                  VP                  V^ ,          VR7      4       \        VP                  VP                  V^,          VR7      4       VR,          R8X  d|   V P                  VP                  VP                  VP                  ^ ,          VP                  ^ ,          VR,          R7      p\        VP                  VP                  WR7      4       R # R # )NrB   r   r   r   r   )r   rH   r2   r8   r9   r   r   rj   rk   r   shape
zstatistic)	r6   kwdsexpectedr@   r7   r8   r9   rl   r   s	   &&&&&    r=   
test_basicTestMannWhitneyU.test_basicU  s     ). $72;Mzz$&&z.

466
0O11(4(rzz(1+Uz'KL

BJJx{%J$HI>\)//

CMM01
AGGAJ<@<O 0 QA CNNBJJqJ,FG	 *rK   r   TFc                ,   VP                  V P                  4      VP                  V P                  4      rT\        WT3R R/VB p\	        VP
                  VP                  V^ ,          4      4       \	        VP                  VP                  V^,          4      4       V P                  VP                  VP
                  VP                  ^ ,          VP                  ^ ,          VR,          R7      p\	        VP                  VP                  V4      4       R# )r   r   r   r   N)
r2   r8   r9   r   r   rj   rk   r   r   r   )r6   r   r   r7   r8   r9   rl   r   s   &&&&    r=   test_continuity TestMannWhitneyU.test_continuityp  s     zz$&&!2::dff#511===rzz(1+'>?

BJJx{$;<++CJJ,-GGAJ
8<]8K , M 	

16rK   c           
        VP                  . RO4      pVP                  . RO4      pVP                  . RO4      R,          pVP                  . RO4      R,          pVP                  VR,
          W4,
          W5,
          W3V,           W4,           VR,           .4      p\        W&R	RR7      p. R
Op. ROp	\        VP                  VP                  V4      4       \        VP                  VP                  V	4      4       R# )r   r   r   )rs   r   Nr          @      @      @)r   r  r  r  rF   )r   r   r   r   r   )r   r   r   r   r   rw   )rT   rv         !@rV   r   rU   rS   )rN   g]U?g[?gi\?gZX<_?gx.?g 
?)r2   stackr   r   rj   r   rk   )
r6   r7   r8   y0dydy2r9   rl   
U_expected
p_expecteds
   &&        r=   test_tie_correct!TestMannWhitneyU.test_tie_correct  s     JJ'(ZZ,-ZZ,-d2jj-.t3HHbgrubfbS&"%DIJ1b>/
I
rzz*'=>

BJJz$:;rK   c           	        \        \        R \        ^ ^ 4      4       ^V P                  ^V P                  ^V P
                  ^V P                  /pVP                  4        EF  w  r#VP                  4        EF  w  rE\        P                  ! ^ \        V4      4      p\        P                  P                  WB4       \        \        P                  P                  VR7      VRR7       \        P                  ! ^ WB,          ^,           4      p\        \        P                  P                  VR7      \        P                  P                  VR7      ,           \        P                  P!                  VR7      ,
          ^4       \        P                  P!                  VR7      p\        WRRR1,          4       \        P                  P                  W$4       \        P                  P!                  VR7      p	\        W4       EK  	  EK  	  R# )s)krM   rC   Nrw   )setattrr   r   pn3pn4pm5pm6itemsr[   r\   lenr  
set_shapesr   r   sfpmf)
r6   p_tablesr   tablemr;   uu2r  pmf2s
   &         r=   test_exact_distribution(TestMannWhitneyU.test_exact_distribution  sg   
Ca,txxDHHa1dhhG (HAIIaQ(''-
 0 01 0 5qtD YYq!#a%(
 0 02 0 6",,,//B/"7!8",,,"2"2R"2"8!9:;=
 !ll&&&,2Y/ ''-!||''"'-*) & )rK   c                   \         P                  P                  R 4      pVP                  VP                  ^4      4      pVP                  VP                  ^4      4      p\	        W4RR7      p\	        W4RR7      pVP
                  VP
                  8X  g   Q hVP                  VP                  VP                  ,
          4      R8  g   Q hVP                  VP                  ^(4      4      pVP                  VP                  ^(4      4      p\	        W4RR7      p\	        W4RR7      pVP
                  VP
                  8X  g   Q hVP                  VP                  VP                  ,
          4      R8  g   Q hR# )i0  r   r   r   r   rM   N)r[   rx   ry   r2   r   rj   absrk   )r6   r7   r{   r8   r9   res1res2s   &&     r=   test_asymptotic_behavior)TestMannWhitneyU.test_asymptotic_behavior  s   ii##E* JJszz!}%JJszz!}%A1A6~~///vvdkkDKK/04777 JJszz"~&JJszz"~&A1A6~~///vvdkkDKK/04777rK   c                   VP                  . RO4      VP                  RR.4      r2\        W#RRR7      p\        W#RRR7      p\        VP                  VP                  4       VP                  R8  g   Q h\        W#R	RR7      p\        VP                  VP                  R4      4       \        VP                  VP                  R 4      4       R
# )r   r  r         @r   r   r   r   r   r   r   Nr   r  r  )r2   r   r   rk   rj   )r6   r7   r8   r9   res_lres_grl   s   &&     r=   test_exact_U_equals_mean)TestMannWhitneyU.test_exact_U_equals_mean  s     zz,'S#J)?1QvgFQyIell3||c!!!1[Irzz"~6

BJJrN3rK   c                0    \        \        R/ VB V4       R# )rN   NrN   rO   )r   r   )r6   r   results   &&&r=   test_scalar_data!TestMannWhitneyU.test_scalar_data   s     	2T2F;rK   c           
        \        \        ^^RR7      R4       \        \        ^^RRR7      R4       \        \        ^^RRR7      R4       \        \        ^^RR7      R\        P                  34       \        \        ^^RRRR	7      R\        P                  34       \        \        ^^RRRR	7      R\        P                  34       \        \        ^^RRR
7      R\        P                  34       R# )rN   r   r   r   r   r   r   r   r   F)r   r   r   )r   r   N)r   rN   )r   r   r[   r3   r6   s   &r=   test_equal_scalar_data'TestMannWhitneyU.test_equal_scalar_data  s     	\!Qw7B\!Q|P	\!Q|S	\!Q|<266]	$
 	\!Q|168:=rvv	H\!Q|168:=rvv	H\!Q|168:=rvv	HrK   c                   \         P                  P                  R 4      pRp^^
reVP                  V^^34      pVP                  ^V^^34      R,           p\        VP	                  V4      VP	                  V4      WR7      p	Rp
V	P
                  P                  V
8X  g   Q hV	P                  P                  V
8X  g   Q h\         P                  ! WtR	4      \         P                  ! WR	4      rVR
,          pVP                  VP                  8X  g   Q h\         P                  ! WzV3,           4      p\         P                  ! WV3,           4      pVP                  RR	 V
8X  g   Q hVP                  RR	 V
8X  g   Q h\         P                  ! V
4      p\         P                  ! V
4      p\        V
 Uu. uF  p\        V4      NK  	  up!   F=  pW~,          pW,          p\        VVVR7      pVP                  W&   VP
                  W&   K?  	  \        V	P
                  VP	                  V4      RR7       \        V	P                  VP	                  V4      RR7       R# u upi )l   2=U r   )r   rs   Nr   缉ؗҜ<rC   )rS   rP   rV   rw   )N.)r[   rx   ry   r   r2   rk   r   rj   moveaxisndimbroadcast_tozerosr   ranger   )r6   r   r7   r{   rs   r  r   r8   r9   rl   r   
statisticspvaluesr|   indicesxiyitemps   &&&               r=   test_gh_12837_11113$TestMannWhitneyU.test_gh_12837_11113  s    ii##J/ "1JJ1ay!JJ1a|$s*2::a="**Q-Rzz5(((}}""e+++ {{1B'Qb)A1iLvvOOAt|,OOAt|,wws|u$$$wws|u$$$ XXe_
((5/5 95aq5 9:GBBBv6D"&..J#{{G ; 	

BJJw$7eDrzz*'=EJ !:s   -Ic                v   . ROp. ROp\        VP                  V4      VP                  V4      RR7      pRV^ &   \        P                  V^&   \        VP                  V4      VP                  V4      RR7      p\	        VP
                  VP
                  4       \	        VP                  VP                  4       R# )rN   r   r   r   Nri   )rP   rS   rU   rV   rv   rP   rO   rN   rQ   rQ   rR   )r   r2   r[   rz   r   rj   rk   )r6   r7   r8   r9   r'  r(  s   &&    r=   test_gh_11355TestMannWhitneyU.test_gh_11355H  s    -BJJqM2::a=N !vv!BJJqM2::a=N7T[[1rK   z	jax.numpyzneeds jax-ml/jax#34490)reasonc                T   . ROp^^^\         P                  ^	^^^^^^.p\        VP                  V4      VP                  V4      4      p\	        VP
                  VP                  VP                  4      4       \	        VP                  VP                  VP                  4      4       R# )r   Nr  )r[   r3   r   r2   r   rj   rk   )r6   r7   r8   r9   res3s   &&   r=   test_gh11355_nan!TestMannWhitneyU.test_gh11355_nanV  s{     1bffaAq!Q2BJJqM2::a=9

266(:;RZZ%78rK         $@g+zQ?r  g}$k\?g     1@g!˛G*?g,s?     8@gFHQ?c                    \        VP                  V4      VP                  V4      R R7      p\        VP                  VP                  V4      RR7       \        VP                  VP                  V4      RR7       R# )r   r   -q=rC   N)r   r2   r   rj   rk   )r6   r8   r9   rj   rk   r7   rl   s   &&&&&& r=   test_gh_11355bTestMannWhitneyU.test_gh_11355bo  sT     2::a="**Q-Mrzz)'<5I

BJJv$6UCrK   c                   R pVP                  . RO4      pVP                  . RO4      p\        WxVW#R7      p	\        V	P                  VP                  V4      4       \	        V	P
                  VP                  V4      4       R# )g     A@r   r   r   N)
r   g(\?g=
ףp=?gp=
ף?g333333?gGz?g(\?g=
ףp=?r,   g\(\?)gffffff?g)\(?r   gGz?g\(\?)r2   r   r   rj   r   rk   )
r6   r   r   r   
pvalue_expr7   statistic_expr8   r9   rl   s
   &&&&&&    r=   test_gh_9184TestMannWhitneyU.test_gh_9184  sg    . JJSTJJ561'2Crzz-'@A

BJJz$:;rK   c                   VP                  VP                  4      pVP                  W"W"V.4      pVP                  W"W"V.4      p\        W44      p\	        VP
                  VP                  V4      4       \	        VP                  V4       R # r   )r2   r3   r  r   r   rj   rk   )r6   r7   r3   abrl   s   &&    r=   test_gh_4067TestMannWhitneyU.test_gh_4067  sn     jj HHc#./HHc#./1 rzz#7

C(rK   r   r,  c                V   \        VP                  V4      VP                  V4      R VRR7      p\        V4      VP                  8X  d   RMRp\	        VP
                  VP                  V^ ,          4      VR7       \	        VP                  VP                  V^,          4      VR7       R# )Tr   r\  ư>rX  rtolN)r   r2   r   r   r   rj   rk   )r6   r8   r9   r   r   r7   rl   ri  s   &&&&&&  r=   test_gh_2118TestMannWhitneyU.test_gh_2118  s{     2::a="**Q-'2<I'+rzz9turzz(1+'>TJ

BJJx{$;$GrK   c                x   \         P                  P                  R 4      p^^rCVP                  VP                  VR7      P	                  4       4      pVP                  VP                  VR7      P	                  4       4      p\        \        R\        ^ ^ 4      4       \        P                  P                  4        \        P                  ! WVRR7      p\        P                  P                  P                  pVR,          \        VP                  W4,          VP                  ,
          4      ^,           8X  g   Q h\        P                  ! WeRR7       V\        P                  P                  P                  8X  g   Q h\        P                  P                  4        \        P                  ! V^ V,          RRR7       \        P                  P                  P                  pVR,          ^8X  g   Q h\        P                  ! ^ V,          VRRR7       V\        P                  P                  P                  8X  g   Q hR# )	   g>mjK rp   r  r   r   r   r9  Nrw   )r[   rx   ry   r2   tolistr  r   r   r  resetr   r   configurationsr   minrj   )	r6   r7   r{   r  r   r8   r9   rl   r   s	   &&       r=   test_gh19692_smaller_table+TestMannWhitneyU.test_gh19692_smaller_table  s   
 ii##$78"1JJszzqz)0023JJszzqz)0023
Ca,  g6++11RyCqsS]]/BCaGGGG10
3399999
 	1ac'yI++11RyA~~1Q3'yI
3399999rK   c                   \         P                  P                  R 4      pVP                  VP                  RR7      4      pVP                  VP                  RR7      4      p\        P
                  ! WE\        P                  ! 4       V^R7      p\        P
                  ! WERV^R7      p\        VP                  VP                  RR7       \        VP                  VP                  RR7       R# )	rm  rp   )r   r   rs   r   V瞯<rh  N)rO   rR   )rO   rS   )
r[   rx   ry   r2   r   r   PermutationMethodr   rj   rk   )r6   r   r7   r{   r8   r9   rl   r(  s   &&&     r=   test_permutation_method(TestMannWhitneyU.test_permutation_method  s    ii##$78JJszzvz./JJszzvz./  e.E.E.G-8qB!!!w.9Ct~~EB

DKKe<rK   g+=c                D   VP                  V P                  4      VP                  V P                  4      r2\        R R7      p\        P
                  ! W#3RR/VB w  rV\        P
                  ! W23RR/VB w  rx\        P
                  ! W#3RR/VB w  r\        P
                  ! W23RR/VB w  r\        Wh4       \        W4       Wj8w  g   Q h\        WQP                  R4      4       \        WqP                  R4      4       \        WP                  R4      4       \        WP                  R4      4       \        WaP                  R4      V P                  R7       VP                  VP                  8X  d   V P                  MR	p\        WP                  R
4      VRR7       R# )r   r   r   r   r         @     Y@g=_A?rh  Mb@?glPz.?r>  ri  rD   N)r2   XYdictr   r   r   r   ri  r@   r   r6   r7   r~  r  kwargsu1r`   r!  rb   u3rd   u4p4ri  s   &&            r=   test_mannwhitneyu_one_sided,TestMannWhitneyU.test_mannwhitneyu_one_sided  sB   zz$&&!2::dff#51\*##AGfGG##AJiJ6J##AJiJ6J##AGfGGxxJJt,-JJt,-JJt,-JJt,-JJ'89		JGGrzz1tyytJJ':;$USrK   c                   VP                  V P                  4      VP                  V P                  4      r2\        R RR7      p\        P
                  ! W#3/ VB w  rV\        P
                  ! W23/ VB w  rx\        Wh4       \        WQP                  R4      4       \        WqP                  R4      4       VP                  VP                  8X  d   V P                  MRp	\        WaP                  R4      V	RR7       R	# )
r   r   r-  rz  r{  r|  glPz.?r>  r}  Nr2   r~  r  r  r   r   r   r@   r   ri  r   
r6   r7   r~  r  r  r  r`   r!  rb   ri  s
   &&        r=   test_mannwhitneyu_two_sided,TestMannWhitneyU.test_mannwhitneyu_two_sided  s    zz$&&!2::dff#51+lC##A3F3##A3F3JJt,-JJt,-GGrzz1tyytJJ'9:ERrK   c                4   VP                  V P                  4      VP                  V P                  4      r2\        R RR7      p\        P
                  ! W#3RR/VB w  rV\        P
                  ! W23RR/VB w  rx\        P
                  ! W#3RR/VB w  r\        P
                  ! W23RR/VB w  r\        Wh4       \        W4       Wj8w  g   Q h\        WQP                  R4      4       \        WqP                  R4      4       \        WP                  R4      4       \        WP                  R4      4       VP                  VP                  8X  d   V P                  MRp\        WaP                  R	4      VR
R7       \        WP                  R4      VR
R7       R# )Fr   r   r   r   r   r   rz  r{  r|  gii5?r>  r}  g22?Nr  r  s   &&            r=   &test_mannwhitneyu_no_correct_one_sided7TestMannWhitneyU.test_mannwhitneyu_no_correct_one_sided  sB   zz$&&!2::dff#51U<@##AGfGG##AJiJ6J##AJiJ6J##AGfGGxxJJt,-JJt,-JJt,-JJt,-GGrzz1tyytJJ'895QJJ';<4eTrK   c                   VP                  V P                  4      VP                  V P                  4      r2\        R RR7      p\        P
                  ! W#3/ VB w  rV\        P
                  ! W23/ VB w  rx\        Wh4       \        WQP                  R4      4       \        WqP                  R4      4       VP                  VP                  8X  d   V P                  MRp	\        WaP                  R4      V	RR7       R	# )
Fr   r  rz  r{  r|  g22?r>  r}  Nr  r  s
   &&        r=   &test_mannwhitneyu_no_correct_two_sided7TestMannWhitneyU.test_mannwhitneyu_no_correct_two_sided0  s    zz$&&!2::dff#51U<@##A3F3##A3F3JJt,-JJt,-GGrzz1tyytJJ';<4eTrK   c                   VP                  . R NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NRNR NR NRNR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR N4      pVP                  . R NR NR NR NR NR NR NRNR NRNR NR NR NR NRNR NR NR NRNR NR NR NR NR NRNR NR NRNR NR NR NR NR NR NR NR NR NR NRNR NRNR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NRNRNR NR NRNR NR NRNR NRNR NR NR NR NRNRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NRNRNRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NRNR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NRNR NR NR NR NR NR N4      p\        RR7      p\        P                  ! W#3RR/VB p\	        VP
                  VP                  R4      4       \	        VP                  VP                  R4      4       \        P                  ! W#3RR	/VB p\	        VP
                  VP                  R4      4       \	        VP                  VP                  R
4      4       \        P                  ! W#3RR/VB p\	        VP
                  VP                  R4      4       \	        VP                  VP                  R4      4       R# )r   r  r  r   r   r   r   g     @g ?չ>r   g&)E?r   g?չ?N)r2   r  r   r   r   rj   rk   )r6   r7   r8   r9   r  rl   s   &&    r=   test_mannwhitneyu_ones'TestMannWhitneyU.test_mannwhitneyu_ones<  s   JJ 0 0B 0 0B 0 0B 0 0B 0 0B 0 0B 0 0B 000 "0$&0(*0,.00204608:0<>0@B0DF0HJ0LN000 "0$&0(*0,.00204608:0<>0@B0DF0HJ0LN0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 	0 	0 !#	0 %'	0 )+	0 -/	0 13	0 57	0 9;	0 =?	0 AC	0 EG	0 IK	0 MO	0
 0
 0
 !#0
 %'0
 )+0
 -/0
 130
 570
 9;0
 =?0
 AC0
 EG0
 IK0
 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0  !0  !0  !#!0  %'!0  )+!0  -/!0  13!0  57!0  9;!0  =?!0  AC!0  EG!0  IK!0  MO!0" #0" #0" !##0" %'#0" )+#0" -/#0 1& JJ ( (B ( (B ( (B ( (B ( (B ( (B ( (B ((( "($&((*(,.(02(46(8:(<>(@B(DF(HJ(LN((( "($&((*(,.(02(46(8:(<>(@B(DF(HJ(LN( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( 	( 	( !#	( %'	( )+	( -/	( 13	( 57	( 9;	( =?	( AC	( EG	( IK	( MO	(
 (
 (
 !#(
 %'(
 )+(
 -/(
 13(
 57(
 9;(
 =?(
 AC(
 EG(
 IK(
 MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( ) \*  D6DVDrzz'':;

BJJ/D$EF  G9GGrzz'':;

BJJ$?@  I;I&Irzz'':;

BJJ/@$ABrK   r   )gm9Aj@g+H3[@gi>s@)g#hA{@glz@gcDf@gǳ*h@gZA@gI9^YQa@g`@g՞p@g:q@g&@gZ|@g`r@gMc3g@)r   
+?)r   
+?)r   缌%c?)r   g9:?)r   g9:?)r   g*::?)r   r   r   )      7@r  )r  r  )r  r  )r  gl,KNh?)r  giژ?)r  gl,KNh?)g      ?r   g      ?)r   皙?r%   r   )r   r   r  r$   r   g?)r  r%   r   )gx&?g/$?gJ+?r%   r   )y&1?v/?gv/?r  gjt?~jt?ʡE?)	gy&1?gV-?r  r   gS?gv?gʡE?g'1Z?gm?)gK7A`?gZd;O?r   gMbX?)Mb?RQ?RQ?M?r  r  )	g;On?;On?V-?g      ?gJ+?r  gx&?r   gCl?)Mb?Mb?Mb?gy&1?r  M?g|?5^?gn?g\(\?!rh?K7?)Mbp?r  r  r  ~jt?g333333?g"~j?ףp=
?gzG?K7?gGz?gl?r   gI+?)r  r  g1Zd?r  )r  r  r  1Zd?g%C?r  r  )
g~jt?g~jt?r  gsh|??gS㥛?r  r  g+?r  r  )g{Gzt?r   g~jt?gL7A`?r  gjt?gPn?gI+?gX9v?gQ?gMb?gsh|??gK7A`?)Mb`?r  g;On?gQ?g9v?gˡE?gT㥛 ?gbX9ȶ?grh|?gQ?r  gx&?gv/?gMbX?g(\?gQ?)rM   r  r  r  g9v?g/$?r  r  gL7A`?g
ףp=
?gQ?r  gK7?g`"?g7A`?r$   gV-?gjt?gˡE?r   r   )r   r   )r   g郡E?)r   rN   )r   r5  )r   rO   rP   rQ   )r8   r9   rj   rk   )Tr   r   g&?)Tr   r   gO?)Tr   r   gO?)Fr   r   g9@VN!x?)Fr   r   g9M>?)Fr   r   g9M>?)Tr   r   g?UV?)Tr   r   gߺVJH?)Tr   r   gVJH?)r   r   r   r]  r.  )r  ga׀}?)r  r   r   )r   g?h?)r   r   )r  g5&#\?)r  r   )r8   r9   r   r   )r   r   r   )g	U3@g^3@gt3@g]o5@gzS4@gt< 4@gM	X3@gXmCk4@gLo&3@gfɘ2@g{m;^3@ga A$|3@gMѢ_4@g#3@g19T_3@ggC2@gqR4@gKk/4@g܁3@gZ2@g_
3@g$`3@g
x4@g3#л5@g;VND1@g >H2@gr4@gyܤ2@g?4@g=bɇ3@)gpG3@gL:j0@g2@gJNnC1@gR;`(3@g+Pi,2@g6:Z2@gZ"3=2@gF	uSa	3@gXҀ2@gX3^83@g21@gJ2@gZ)E2@gU83@g50@gԆ3@gFz33@gz3@gڴ3@)5r   r   r   r   r   r   r   r   r8   r9   cases_basicr4   r   r   r   cases_continuityr   r  r  r  r  r  r#  r)  r1  cases_scalarr6  r;  rK  rN  skip_xp_backendsrS  r[   rz   cases_11355rY  
cases_9184r_  rd  
cases_2118rj  rr  rw  r~  r  ri  r  r  r  r  r  r   r   r   s   @r=   r   r      s-    -*
.60t 	-A	A& #K<H*,"FHlC*,"IxF*,"K7C*,"FHg>*,"IxA*,-K [[1;?[[W&BC
H D @
H (6FM/1'1A4H/1'4DdK/1'6FN/1'1A5I/1'4DeL/12 [[13CD7 E7&<, $8.0Coq"A<KMC (7K 2 <=C *? 1 9  G $%C+88*4" $[(LI#VX|D #Y,G)+#[(GDgN#VXw?K#Y'BGLNL [[/>< ?<H. [[Xg'>?)K @)KV2 k*BC9 D9 "1aAq!Q:* "1aAq!Q?)+ 2661%1aAq!Q:/+ 2661%1aAq!Q?* *1aAq!Q?/+,K  [[>LD MD ?BC@CE:=?AJ [[ 67AC<C<: k*BC) D)  #sY8MN#sV5JK#s[)Dqc9.CDqc6+@Aqc;	:q6Aq69.BCq6Aq66+?@q6Aq6;9;J [[BJOH PH:: [[],LM	= N	=	-A	NA DT&
SU&
U,C ,CrK   r   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR t]P                   P#                  RR4      R 4       tR tRtV tR# )TestSomersDik  c                   V P                   V P                  ,           V n        ^ \        P                  ! ^
4      V P                   V P                  ,           3^\        P                  ! ^
4      V P                   V P                  ,           3/V n        V P
                   Uu. uF  qP
                  V,          ^ ,          NK  	  pp\        P                  ! \        P                  RR7      V n
        V P                  ! V!  V n        R# u upi )r   r   r   N)ALL_INTEGER	ALL_FLOATdtypesr[   r\   	arguments	functoolspartialr   somersdpartialfuncr   )r6   idxinput_arrays   &  r=   setup_methodTestSomersD.setup_methodl  s    &&7biim"..?Abiim"..?AB :>H#~~c*1--H
 %,,U]]9DF((+6 Is   "Dc                    V P                   ! V!  p\        VP                  V P                  P                  R R7       \        VP                  V P                  P                  R R7       R# )ru  rC   N)r  r   rj   r   rk   )r6   r   rl   s   &* r=   pythranfuncTestSomersD.pythranfunc{  sF    %t}}'>'>UK

DMM$8$8uErK   c                <   . RO. RO. RO.p\         P                  ! V4      pV P                  \         P                  4      p\         P                  ! V3/ VB p\        VP                  VP                  RR7       \        VP
                  VP
                  RR7       R# )   ru  rC   N)r        rU   r   )rU   r     #   ru   )rN   rP   rO   rU      )r   r  get_optional_argsr   rj   rk   )r6   r  r'  optional_argsr(  s   &    r=   test_pythranfunc_keywords%TestSomersD.test_pythranfunc_keywords  sm    #%8:JK}}U#..u}}=}}U4m4UCT[[u=rK   c                   . ROp. ROpRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       . R	Op. R
OpRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       . ROp. ROpRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! ^
4      pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! . RO4      pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! ^
4      RRR1,          pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! . RO4      pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       . ROp. ROpRp\         P                  ! WV4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \         P                  ! . RO. RO4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! . RO. RO4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! . RO. RO4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! ^ .^ .4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! . . 4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \
        P                  ! R4      p\
        P                  ! R4      p\        \        \         P                  W4       R# )rR   ru  rC   NrU        4@)rR   rO   rN   rP   rS   rQ   rU   rV   )rR   rO   rS   rP   rN   rV   rU   rQ   r  )	r   rR   rO   rN   rP   rS   rQ   rU   rV   )	rR   rO   r   rS   rP   rN   rV   rU   rQ   )rR   rO   rN   rP   rS   rQ   rU   )rR   rO   rS   rP   rN   rU   rQ   )g+$I$I¿g=/3n+?r   r   )
r   rO   rN   rP   rQ   rS   rR   rU   rV   rv   )gs'}'?r   rw   )g      r   )
rv   rU   rV   rS   rR   rP   rQ   rO   rN   r   )g}'}'r   )ru   rO   rN   ru   rO   )rN   rQ   rU   rN   r   )      g.ʂ?)rO   rO   rO   )rO   r   rO   )r   r  r   rj   rk   r[   r\   arrayr3   r   r5   )r6   r8   r9   r   rl   x1x2s   &      r=   test_like_kendalltau TestSomersD.test_like_kendalltau  s    %$9mmA!x{?

HQKe< ('9mmA!x{?

HQKe< "!:mmA!x{?

HQKe< IIbMIIbM *mmA!x{?

HQKe< IIbMHH349mmA!x{?

HQKe< IIbMIIbM$B$ +mmA!x{?

HQKe< IIbMHH34;mmA!x{?

HQKe< :mmB#x{?

HQKe< mmIy1rvv.

BFF+mmIy1rvv.

BFF+mmIy1rvv.

BFF+mmQC!%rvv.

BFF+ mmB#rvv.

BFF+ IIcNIIcNj%--6rK   c                   . ROp. R	OpRpRpRp\         P                  ! W4      p\        VP                  VRR7       \        VP                  VRR7       \        VP                  P                  R
4       \         P                  ! W!4      p\        VP                  VRR7       \        VP                  VRR7       \        VP                  P                  R4       R# )rN   gCE]t?g^_?gO((Ƿ?ru  rC   rE   N)rN   rN   rN   rO   rO   rO   rO   rO   rP   rP   rN   rO   rO   rO   rO   rO   rO   rO   rP   rP   rP   rP   rP   rP   )rN   rN   rN   rN   rN   rN   rN   rN   rN   rN   rO   rO   rO   rO   rO   rO   rO   rO   rO   rO   rO   rO   rO   rO   )rP   rO   rO   rP   )r   r  r   rj   rk   r   r  r   )r6   r8   r9   d_crd_rcr;   rl   s   &      r=   test_asymmetryTestSomersD.test_asymmetry  s    11 ! mmA!t%8

AD1SYY__f-mmA!t%8

AE2SYY__f-rK   c                j   \         P                  ! ^^.^^.^^.^^.^^..4      pVP                  pRp\        \        P
                  ! V4      P                  V4       \         P                  ! ^^ .^U^ .^ ^..4      pRRr#\        \        P
                  ! V4      P                  V4       \        \        P
                  ! VP                  4      P                  V4       \         P                  ! ^^ .^ ^.^U^ ..4      pRp\        \        P
                  ! VP                  4      P                  V4       R# )rV   NgHHHHHH?gM&w?r   gtE]t)r[   r  Tr   r   r  rj   )r6   r  dyxdxys   &   r=   test_somers_original TestSomersD.test_somers_original  s    
 1a&1a&1a&1a&1a&ABe,66< 2q'B7QG45iSe,66<egg.88#> 2q'Ar7RG45egg.88#>rK   c                   ^dpRp\         P                  ! V4      p\         P                  P                  ^ 4      p\        P
                  P                  V\         P                  ! V4      V,          VR7      P                  V4      p\        P                  ! V4      p\         P                  ! V^\         P                  ! V^,          4      ^ R7      p\        P                  ! V4      p\         P                  ! V^\         P                  ! V^ ,          4      ^R7      p	\        P                  ! V	4      p
\         P                  ! V^\         P                  ! V^ ,          ^,           4      ^R7      p\        P                  ! V4      p\        VP                  RRR7       \        VP                  VP                  4       \        VP                  V
P                  4       \        VP                  VP                  4       \        VP                  RRR7       \        VP                  VP                  4       \        VP                  V
P                  4       \        VP                  VP                  4       R# )	r   r;   random_staterr   ru  rC   gPj$?NrQ   rS   gay)r[   prodrx   RandomStater   multinomialrvsr   reshaper  insertrC  r   rj   rk   )r6   Nr   rq   r{   r  rl   s2r(  s3rR  s4res4s   &            r=   *test_contingency_table_with_zero_rows_cols6TestSomersD.test_contingency_table_with_zero_rows_cols)  s    wwu~ii##A&!!!rwwt}T'9/2 " 44;GEN 	
mmAYYq!RXXeAh/a8}}R YYq!RXXeAh/a8}}R YYr1bhhuQxz2;}}R  	'9Ft~~6t~~6t~~6

$5EB

DKK0

DKK0

DKK0rK   c                   ^dpRp\         P                  ! V4      p\         P                  P                  ^ 4      p\        P
                  P                  V\         P                  ! V4      V,          VR7      P                  V4      pV^,
          pRp\        \        VR7      ;_uu_ 4        \        P                  ! V4       RRR4       VR,           pRp\        \        VR7      ;_uu_ 4        \        P                  ! V4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! . .4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! ^..4       RRR4       \         P                  ! R	4      p	\        \        VR7      ;_uu_ 4        \        P                  ! V	4       RRR4       ^V	R
&   \        \        VR7      ;_uu_ 4        \        P                  ! V	4       RRR4       R#   + '       g   i     ELV; i  + '       g   i     EL'; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r  z:All elements of the contingency table must be non-negativer'   Nr   z5All elements of the contingency table must be integerz?At least two elements of the contingency table must be nonzero.r  )rP   rP   r   rN   )r[   r  rx   ry   r   r  r  r   r  r   r5   r  rC  )
r6   r  r   rq   r{   r  s5r<   s6s7s
   &         r=   test_invalid_contingency_tables+TestSomersD.test_invalid_contingency_tablesI  s   wwu~ii##A&!!!rwwt}T'9/2 " 44;GEN 	
 UN:W55MM" 6 XI:W55MM" 6,:W55MM2$ 6 :W55MMA3%  6 XXf:W55MM" 6 4:W55MM" 65+ 655
 655
 65 65 65 655sH   *H-H"'H6 I	0I-I/H	"H3	6I		I	I,	/J 	c                <   . ROpRR\         P                  .p. ROp^ R\         P                  ) .p\        P                  ! W4      p\        P                  ! W$4      p\	        VP
                  VP
                  4       \	        VP                  VP                  4       R# )rN   g @Nr   rw   )rP   rO   rN   r  )r[   rz   r   r  r   rj   rk   )r6   r8   r  r9   y2rl   r(  s   &      r=   test_only_ranks_matter"TestSomersD.test_only_ranks_matterm  sn    #rvvwmmA!}}R$S]]DNN3SZZ-rK   c                    \         P                  ! ^
4      p\         P                  ! ^
4      p\        P                  ! W4      p\	        VP
                  \         P                  ! ^
4      4       R# )rT   N)r[   r\   r   r  r   r  eye)r6   r8   r9   rl   s   &   r=   test_contingency_table_return)TestSomersD.test_contingency_table_returnx  s@    IIbMIIbMmmA!SYYr
+rK   c                   . R	Op. R
Op\         P                  ! WRR7      pVP                  ^ 8  g   Q h\         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  ^VP
                  ^,          ,
          4       \         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  VP
                  ^,          4       VP                  4        \         P                  ! WRR7      pVP                  ^ 8  g   Q h\         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  ^VP
                  ^,          ,
          4       \         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  VP
                  ^,          4       \        P                  ! \        RR7      ;_uu_ 4        \         P                  ! WRR7       RRR4       R#   + '       g   i     R# ; i)rN   r   r   r   r   z`alternative` must be...r'   	ekki-ekkiN)rN   rO   rP   rQ   rR   )rR   rS   rU   rV   rU   )
r   r  rj   r   r   rk   reverser4   r   r5   )r6   r  r  r   rl   s   &    r=   test_somersd_alternative$TestSomersD.test_somersd_alternative  s     ==[A!!A%%% mmB7S]]H$6$67

A1)<$=> mmB	:S]]H$6$67

HOOa$78 	

 ==[A!!A%%% mmB	:S]]H$6$67

A1)<$=> mmB7S]]H$6$67

HOOa$78]]:-GHHMM"k: IHHHs   I  I	positive_correlationc                &   \         P                  ! ^
4      pV'       d   TM\         P                  ! V4      pV'       d   ^MRp\        P                  ! W#RR7      pVP
                  V8X  g   Q hVP                  ^ 8X  g   Q h\        P                  ! W#RR7      pVP
                  V8X  g   Q hVP                  V'       d   ^M^ 8X  g   Q h\        P                  ! W#RR7      pVP
                  V8X  g   Q hVP                  V'       d   ^ M^8X  g   Q hR# )rT   r   r   r   r   Nrw   )r[   r\   flipr   r  rj   rk   )r6   r  r  r  expected_statisticrl   s   &&    r=    test_somersd_perfect_correlation,TestSomersD.test_somersd_perfect_correlation  s     YYr]'RRWWR["6QB mmB<}} 2222zzQ mmB7}} 2222zz#7aQ??? mmB	:}} 2222zz#7aQ???rK   c                    ^^.pRp\         P                  P                  R4      pVP                  W4      pVP                  W4      pRp\        P
                  ! WE4      P                  p\        WgRR7       R# )rN   l   .E5 g 0uD?ru  rC   N@B )r[   rx   ry   choicer   r  rj   r   )r6   classes	n_samplesr{   r8   r9   val_sklearn	val_scipys   &       r=   !test_somersd_large_inputs_gh18132-TestSomersD.test_somersd_large_inputs_gh18132  si     a&	ii##J/JJw*JJw* + MM!'11	U;rK   )r  r  r   r  N)FT)r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r4   r   r   r  r  r   r   r   s   @r=   r  r  k  su     7F
	>m7^.2?,1@"H	.,';R [[3]C@ D@0< <rK   r  c                     a  ] tR tRt o Rt]P                  P                  R^+^(.^
^'..R3^d^.R^..R3^^.^^..R3^^.^
^
..R3^^.^^..R3^^.^^..R3^
^.^
^..R3^^ .^^..R3^ ^.^^..R3^ ^.^^..R3^^.^^..R3.4      R 4       t]P                  P                  R^+^(.^
^'..R3^d^.R^..R3^^.^^..R3^^.^
^
..R 3^^.^^..R!3^^.^^..R"3^
^.^
^..R#3^^ .^^..R$3^ ^.^^..R%3^ ^.^^..R&3^^.^^..R3.4      R 4       t	R t
]P                  P                  R^ ^ .^^..R'3.4      R	 4       t]P                  P                  R^ ^.^ ^
..R]P                  33^^ .^
^ ..R]P                  33.4      R
 4       t]P                  P                  R^^.^^..R(3^^.R^..R)3^^.R^..R*3.4      ]P                  P                  RRR.4      R 4       4       tRtV tR# )+TestBarnardExacti  z8Some tests to show that barnard_exact() works correctly.input_sample,expectedr   c                d    \        V4      pVP                  VP                  rT\        WE.V4       R# )zThe expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-6 :
```R
library(Barnard)
options(digits=10)
barnard.test(43, 40, 10, 39, dp=1e-6, pooled=TRUE)
```
Nr   rj   rk   r   r6   input_sampler   rl   rj   rk   s   &&&   r=   test_preciseTestBarnardExact.test_precise  s*    2 L)MM3::6+X6rK   c                h    \        VRR7      pVP                  VP                  rT\        WE.V4       R# )zThe expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-6 :
```R
library(Barnard)
options(digits=10)
barnard.test(43, 40, 10, 39, dp=1e-6, pooled=FALSE)
```
F)pooledNr%  r&  s   &&&   r=   test_pooled_param"TestBarnardExact.test_pooled_param  s,    2 L7MM3::6+X6rK   c                   R p\        \        VR7      ;_uu_ 4        \        ^^.^^..^ R7       RRR4       Rp\        \        VR7      ;_uu_ 4        \        \        P                  ! ^4      P                  ^^4      4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        R^.^^..4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        ^^.^^..R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Ln; i  + '       g   i     R# ; i)	7Number of points `n` must be strictly positive, found 0r'   r   N,The input `table` must be of shape \(2, 2\).*All values in `table` must be nonnegative.zI`alternative` should be one of {'two-sided', 'less', 'greater'}, found .*not-correctrw   )r   r5   r   r[   r\   r  r6   	error_msgs   & r=   test_raisesTestBarnardExact.test_raises  s     F 	 :Y77Aq6Aq6*a0 8 E	:Y77"))A,..q!45 8 A	:Y77B7QF+, 8
 	 :Y77Aq6Aq6*M: 87% 87
 87
 87 877/   C80D&DD18D	D	D.	1E	r   c                    \        V4      pVP                  VP                  rT\        WR^ ,          4       \        WB^,          4       R# r   Nr   rj   rk   r   r&  s   &&&   r=   test_edge_cases TestBarnardExact.test_edge_cases1  s5     L)MM3::6Va[)Y,rK   c                    \        V4      pVP                  VP                  rT\        WR^ ,          4       \        WB^,          4       R# r:  r;  r&  s   &&&   r=   test_row_or_col_zero%TestBarnardExact.test_row_or_col_zero=  s5     L)MM3::6Va[)Y,rK   ,  i  r   r   r   c                    Vw  rEVR8X  d&   \         P                  ! V4      RRRR13,          pV) p\        WR7      pVP                  VP                  r\        Wx.WE.RR7       R# )a0  
"The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-6 :
```R
library(Barnard)
options(digits=10)
a = barnard.test(2, 7, 8, 2, dp=1e-6, pooled=TRUE)
a$p.value[1]
```
In this test, we are using the "one-sided" return value `a$p.value[1]`
to test our pvalue.
r   :NNNNr   Hz>rC   rw   )r[   r  r   rj   rk   r   )	r6   r'  r   r   expected_statless_pvalue_expectrl   rj   rk   s	   &&&&     r=   test_less_greater"TestBarnardExact.test_less_greaterJ  sd    , -5))#88L1!TrT':L*NMLBMM3::6-!D4	
rK   r   N)gXyq@g{2s&Q7?)gllgEA]0K?)*)1%g_  ?)g_c1?g= ?)g5PyQgQ@2?)ggJ"?)g_c1gwݝل?)g7@g      ?)g~t,?3O?)gr?~CY7?)g7\@gA2?)gXS;gh?)g>!Ɏg6  ?)gSy@?g^F?)g-gXI#?)gaЍgo?)gb]?gFugH	?)g6ҭ@g      ?)gi(	rI  )gNXzrJ  r  )rH  gE\/??)ggQ5r   )g&X}>r   )r   r   r   r   __doc__r4   r   r   r(  r,  r6  r<  r[   r3   r?  rF  r   r   r   s   @r=   r"  r"    sx    B[[2hR!#CDAhq	"$EF!fq!f@A!fr2h!AB"gBx "CD"gBx "CD1gAw!BC!fq!f?@!fq!f@A!fq!f@A!fq!f@A	
 7! 7 [[2hR!#CDAhq	"$EF!fq!f@A!fr2h!AB"gBx "CD"gBx "CD1gAw!BC!fq!f?@!fq!f@A!fq!f@A!fq!f@A	
 7! 7;4 [[!fq!fx(	
-- [[!fq"gbff.!fr1gbff.	
-- [[!fq!f@A#ha!#:;2hq	"$;<	
 [[]Y,?@
 A
rK   r"  c                     a  ] tR tRt o RtRt]P                  P                  R^^.^^..R3^^.^
^
..R3^^.^^..R3^
^.^
^..R3^^ .^^..R3^ ^.^^..R3^^.^^..R3^^.^^..R3^
^.^^%..R3.	4      R 4       t	]P                  P                  R^+^(.^
^'..R3^^.^^..R3^^.^
^
..R3^^.^^..R3^^.^^..R3^^ .^^..R3^ ^.^^..R3^ ^.^^..R3^^.^^..R3^^.^^..R3^
^.^^%..R3.4      R 4       t
]P                  P                  R^+^(.^
^'..R3^^.^^..R 3^^.^
^
..R!3^^.^^..R"3^^ .^^..R#3^ ^.^^..R$3^^.^^..R 3^^.^^..R%3.4      R 4       tR t]P                  P                  R^ ^.^ ^
..]P                  ]P                  33^^ .^
^ ..]P                  ]P                  33.4      R	 4       tR
 t]P                  P                  RR&4      R 4       tRtV tR# )'TestBoschlooExactim  z9Some tests to show that boschloo_exact() works correctly.rC  r#  c                ~    \        VRR7      pVP                  VP                  rT\        WE.W P                  R7       R# )aA  The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-8 :
```R
library(Exact)
options(digits=10)
data <- matrix(c(43, 10, 40, 39), 2, 2, byrow=TRUE)
a = exact.test(data, method="Boschloo", alternative="less",
               tsmethod="central", np.interval=TRUE, beta=1e-8)
```
r   r   rC   Nr   rj   rk   r   ATOLr&  s   &&&   r=   	test_lessTestBoschlooExact.test_lessr  s0    2 \v>MM3::6+XIIFrK   c                ~    \        VRR7      pVP                  VP                  rT\        WE.W P                  R7       R# )aD  The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-8 :
```R
library(Exact)
options(digits=10)
data <- matrix(c(43, 10, 40, 39), 2, 2, byrow=TRUE)
a = exact.test(data, method="Boschloo", alternative="greater",
               tsmethod="central", np.interval=TRUE, beta=1e-8)
```
r   r   rC   NrO  r&  s   &&&   r=   test_greaterTestBoschlooExact.test_greater  s0    6 \yAMM3::6+XIIFrK   c                    \        VR^@R7      pVP                  VP                  rT\        WE.W P                  R7       R# )aF  The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-8 :
```R
library(Exact)
options(digits=10)
data <- matrix(c(43, 10, 40, 39), 2, 2, byrow=TRUE)
a = exact.test(data, method="Boschloo", alternative="two.sided",
               tsmethod="central", np.interval=TRUE, beta=1e-8)
```
r   )r   r   rC   NrO  r&  s   &&&   r=   test_two_sided TestBoschlooExact.test_two_sided  s2    0 \{bIMM3::6+XIIFrK   c                   R p\        \        VR7      ;_uu_ 4        \        ^^.^^..^ R7       RRR4       Rp\        \        VR7      ;_uu_ 4        \        \        P                  ! ^4      P                  ^^4      4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        R^.^^..4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        ^^.^^..R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Ln; i  + '       g   i     R# ; i)	r/  r'   r0  Nr1  r2  zK`alternative` should be one of \('two-sided', 'less', 'greater'\), found .*r3  rw   )r   r5   r   r[   r\   r  r4  s   & r=   r6  TestBoschlooExact.test_raises  s     F 	 :Y77QFQF+q1 8 E	:Y77299Q<//156 8 A	:Y77RGaV,- 8
% 	 :Y77QFQF+]; 87% 87
 87
 87 877r8  c                    \        V4      pVP                  VP                  rT\        WR^ ,          4       \        WB^,          4       R# r:  )r   rj   rk   r   r&  s   &&&   r=   r?  &TestBoschlooExact.test_row_or_col_zero  s5     \*MM3::6Va[)Y,rK   c                    ^^.^^..p\        VRR7      P                  p\        VRR7      P                  p^\        W#4      ,          ^8  g   Q h\        VRR7      P                  pVR8X  g   Q hR# )rN   r   r   r   r   r   N)r   rk   rq  )r6   tblplpgpts   &    r=   test_two_sided_gt_1%TestBoschlooExact.test_two_sided_gt_1  sn     1vBx CV4;;CY7>>R}q   C[9@@SyyrK   r   c                    ^^.^^..p\        W!R7      P                  p\        P                  ! W!R7      ^,          p\	        W44       R# )rO   r   N)r   rj   r   fisher_exactr   )r6   r   r^  boschloo_statfisher_ps   &&   r=   test_against_fisher_exact+TestBoschlooExact.test_against_fisher_exact  sC     1v1v&sDNN%%cCAF0rK   r   N)<vB\?g/??)gM?gA>?)_VѶ?g֭?)u %?gc'?)rN   rN   )r   g      ?)+f?gXc}v?)gZыD?ggi]?)k\2?g0,%?)gKv?gN3?)rl  g'&5?)gw@_?g7?)gi{?gɑ)z?)օa?g1|?)gY<;?gND?)ge?gG`?)rn  gqQS,5?)rj  gG?/??)rl  gKE`?)rk  ghr1ֽ?)ro  grfb?)r   g      ?)rm  gP:pRv?r   )r   r   r   r   rK  rP  r4   r   r   rQ  rT  rW  r6  r[   r3   r?  rb  rh  r   r   r   s   @r=   rM  rM  m  s    CD[[!fq!f89!fr2h!78"gBx ":;1gAw!89!fq!fv&!fq!f~.!fq!f89"g1v 892hR!#9:
	
GG [[2hR!#?@!fq!f56!fr2h!89"gBx "89"gBx "78!fq!f89!fq!fv&!fq!fv&!fq!f56"g1v 672hR!#9:	
 G! G [[2hR!#?@!fq!f78!fr2h!78"gBx "89!fq!f78!fq!f}-!fq!f78"g1v 89		
GG <4 [[!fq"g 01!fr1g 01	
-- [[],?@1 A1rK   rM  c                     a  ] tR tRt o ]P
                  P                  R. ]P                  ! ^4      3]P                  ! ^4      ^.3.4      R 4       t	R t
R t]P
                  P                  R. RO4      R 4       t]P
                  P                  R	. RO4      R
 4       t]P
                  P                  R 4       tR tR tR tRtV tR# )TestCvm_2sampi  r   c                d  a V3R  lV 4       p\        \        \        SR7      ;_uu_ 4        \        V!  p\	        VP
                  SP                  SP                  4      4       \	        VP                  SP                  SP                  4      4       RRR4       R#   + '       g   i     R# ; i)c              3   \   <"   T F!  pSP                  V\        S4      R 7      x  K#  	  R# 5i)rB   N)r2   r   ).0argr7   s   & r=   	<genexpr>5TestCvm_2samp.test_too_small_input.<locals>.<genexpr>  s'     Lt

3&6r&:
;;ts   ),rh   N)	r   r   r    r   r   rj   r2   r3   rk   )r6   r   r7   rl   s   &&f r=   test_too_small_input"TestCvm_2samp.test_too_small_input  sq     MtL+3HRPP&-CCMM2::bff+=>CJJ

266(:; QPPPs   A(BB/	c                    VP                  ^4      pRp\        P                  ! \        VR7      ;_uu_ 4        \	        W"R4       RRR4       R#   + '       g   i     R# ; i)rR   z/method must be either auto, exact or asymptoticr'   xyzN)r\   r4   r   r5   r   )r6   r7   r9   msgs   &&  r=   r    TestCvm_2samp.test_invalid_input  s>    IIaL?]]:S11 u- 2111s   AA 	c                   . ROp. ROp\        W4      p\        \        P                  ! V4      \        P                  ! V4      4      p\        VP                  VP
                  3VP                  VP
                  34       R# )rO   N)rO   rP   rQ   rU   rS   )r  r   ru   r  )r   r[   r  r   rj   rk   )r6   r8   r9   r1r2s   &    r=   test_list_inputTestCvm_2samp.test_list_input  sV    !!'!"((1+rxx{;bllBII.ryy0IJrK   r@   Nc                H   Vf   \        V4      M
\        W!4      pVP                  . ROVR7      pVP                  . ROVR7      p\        W44      p\	        VP
                  VP                  RVR7      RR7       \	        VP                  VP                  RVR7      RR7       R # )	NrB   gS㥛?rM   rC   g
ףp=
?r   )	gffffff@g @rG   gffffff!@皙"@g#@g333333$@g333333%@gffffff&@)g@g@g@      @333333@gffffff @g333333"@g#@g%@g&@g      '@g(@g      )@g*@g333333-@)r   rH   r2   r   r   rj   rk   )r6   r@   r7   r8   r9   rs   &&&   r=   test_example_conover"TestCvm_2samp.test_example_conover  s     ). $72;MJJGuJUJJ BIN  P &RZZUZ%C$O"**S*">TJrK   zstatistic, m, n, pvalc                2    \        \        WV4      V4       R # r   )r   r   )r6   rj   r  r   pvals   &&&&&r=   test_exact_pvalueTestCvm_2samp.test_exact_pvalue*  s     	*9;TBrK   c                   \         P                  P                  R 4      p\        P                  P                  RVR7      p\        P                  P                  RVR7      pVP                  V4      VP                  V4      rC\        W44      p^ VP                  u;8  d	   ^8  g   Q h Q h\        W4R,           4      p^ VP                  u;8  d	   ^8  g   Q h Q hR# )i  r  )rq   r  i r   N)	r[   rx   ry   r
   normr  r2   r   rk   )r6   r7   r{   r8   r9   r  s   &&    r=   test_large_sampleTestCvm_2samp.test_large_sample5  s     ii##D)""c"B""S"Azz!}bjjm1 &188a cE*188arK   c                |   \         P                  P                  ^ 4      pVP                  VP                  ^4      4      pVP                  VP                  ^4      4      p\	        W4RR7      p\	        W4RR7      p\        VP                  VP                  4       \        VP                  VP                  RR7       R# )r   r   r   r   r   rC   N)	r[   rx   r  r2   r   r   rj   r   rk   )r6   r7   r{   r8   r9   r  r  s   &&     r=   test_exact_vs_asymptotic&TestCvm_2samp.test_exact_vs_asymptoticB  s    ii##A&JJszz!}%JJszz!}%!!w7!!|<bll3		29948rK   c                X   VP                  R 4      pVP                  . RO4      p\        W#RR7      p\        W#RR7      p\        VP                  VP                  4       VP                  R4      p\        W#RR7      p\        W#RR7      p\        VP                  VP                  4       R# )r  r   r   r   g      5@r   N)r   g@g333333*@)r\   r2   r   r   rk   )r6   r7   r8   r9   r  r  s   &&    r=   test_method_autoTestCvm_2samp.test_method_autoK  s    IIcNJJ'(!!w7!!v6		299-IIcN!!|<!!v6		299-rK   c                   VP                  ^4      p\        W"4      p\        VP                  VP	                  R4      4       \        VP
                  VP	                  R4      4       \        VR,          VR,          4      p\        VP                  VP	                  R4      4       \        VP
                  VP	                  R4      4       R# )   r   r   :NrQ   NN)r\   r   r   rj   r2   rk   )r6   r7   r8   rl   s   &&  r=   test_same_inputTestCvm_2samp.test_same_inputW  s     IIbM"1(rzz"~6

BJJrN3"1R5!B%0rzz"~6

BJJrN3rK   r   r   ))i  rR   rS   gcj`?)ii  rU   rU   gtE]t?)i@  rQ   rS   g88?)i  rS   rU   gXwS?)r   r   r   r   r4   r   r   r[   r\   rx  r   r  r  r  xslowr  r  r  r  r   r   r   s   @r=   rq  rq    s     [[Vr299Q<&8')yy|aS&9&; <<<<.K [[W&BC	K D	K [[456
C6
C [[
  
 9
.4 4rK   rq  c                     a  ] tR tRt o . RO. R O. R!O3t. R"O. R O. R!O3t. R#O. R$O. R!O3tRtRtRt	]
P                  P                  R]]R3]]R3]]	R33. R%OR	7      R
 4       tRtRt]
P                  P                  R]]R3]]R33RR.R	7      R 4       tR tR tR tR tR tR tR t]
P                  P                  RR&4      R 4       t]
P                  P                  R. R'O4      R 4       tR tRtV tR# )(TestTukeyHSDie  aK  
    Comparison LowerCL Difference UpperCL Significance
    2 - 3	0.6908830568	4.34	7.989116943	    1
    2 - 1	0.9508830568	4.6 	8.249116943 	1
    3 - 2	-7.989116943	-4.34	-0.6908830568	1
    3 - 1	-3.389116943	0.26	3.909116943	    0
    1 - 2	-8.249116943	-4.6	-0.9508830568	1
    1 - 3	-3.909116943	-0.26	3.389116943	    0
    aS  
    Comparison LowerCL Difference UpperCL Significance
    2 - 1	0.2679292645	3.645	7.022070736	    1
    2 - 3	0.5934764007	4.34	8.086523599	    1
    1 - 2	-7.022070736	-3.645	-0.2679292645	1
    1 - 3	-2.682070736	0.695	4.072070736	    0
    3 - 2	-8.086523599	-4.34	-0.5934764007	1
    3 - 1	-4.072070736	-0.695	2.682070736	    0
    aS  
    Comparison LowerCL Difference UpperCL Significance
    2 - 3	1.561605075	    4.34	7.118394925	    1
    2 - 1	2.740784879	    6.08	9.419215121	    1
    3 - 2	-7.118394925	-4.34	-1.561605075	1
    3 - 1	-1.964526566	1.74	5.444526566	    0
    1 - 2	-9.419215121	-6.08	-2.740784879	1
    1 - 3	-5.444526566	-1.74	1.964526566	    0
    zdata,res_expect_str,atolrE   g|=equal size sampleidsc                P   \         P                  ! VP                  RR4      P                  4       R,          \        R7      P                  R4      p\        P                  ! V!  pVP                  4       pV F  w  rxrr\        V4      ^,
          \        V4      ^,
          r\        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          R8*  V^8H  4       K  	  R# )	a  
SAS code used to generate results for each sample:
DATA ACHE;
INPUT BRAND RELIEF;
CARDS;
1 24.5
...
3 27.8
;
ods graphics on;   ODS RTF;ODS LISTING CLOSE;
   PROC ANOVA DATA=ACHE;
   CLASS BRAND;
   MODEL RELIEF=BRAND;
   MEANS BRAND/TUKEY CLDIFF;
   TITLE 'COMPARE RELIEF ACROSS MEDICINES  - ANOVA EXAMPLE';
   ods output  CLDiffs =tc;
proc print data=tc;
    format LowerCL 17.16 UpperCL 17.16 Difference 17.16;
    title "Output with many digits";
RUN;
QUIT;
ODS RTF close;
ODS LISTING;
 -  rR   NNrB   rC   r   N)rS   rS   r[   r2   replacesplitfloatr  r   	tukey_hsdconfidence_intervalintr   lowrj   highrk   )r6   datares_expect_strrD   
res_expect	res_tukeyconfr|   jlr  hsigs   &&&&         r=   test_compare_sasTestTukeyHSD.test_compare_sas  s    B ZZ 6 6uc B H H J2 N&+--4WV_ 	OOT*	,,.",A!q6A:s1vzqDHHQTNA9I//5qDDIIadOQ:Y--ad3s:SAXF #-rK   z
        1	2	-8.2491590248597	-4.6	-0.9508409751403	0.0144483269098
        1	3	-3.9091590248597	-0.26	3.3891590248597	0.9803107240900
        2	3	0.6908409751403	4.34	7.9891590248597	0.0203311368795
        z
        1	2	-7.02207069748501	-3.645	-0.26792930251500 0.03371498443080
        1	3	-2.68207069748500	0.695	4.07207069748500 0.85572267328807
        2	3	0.59347644287720	4.34	8.08652355712281 0.02259047020620
        rX  rC  zunequal size samplec                   \         P                  ! VP                  4       \        R7      P	                  R4      p\
        P                  ! V!  pVP                  4       pV F  w  rxrr\        V4      ^,
          \        V4      ^,
          r\        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       K  	  R# )a6  
vals = [24.5, 23.5,  26.4, 27.1, 29.9, 28.4, 34.2, 29.5, 32.2, 30.1,
 26.1, 28.3, 24.3, 26.2, 27.8]
names = {'zero', 'zero', 'zero', 'zero', 'zero', 'one', 'one', 'one',
 'one', 'one', 'two', 'two', 'two', 'two', 'two'}
[p,t,stats] = anova1(vals,names,"off");
[c,m,h,nms] = multcompare(stats, "CType","hsd");
rB   rC   NrP   rS   )r[   r2   r  r  r  r   r  r  r  r   r  rj   r  rk   )r6   r  r  rD   r  r  r  r|   r  r  r  r  r;   s   &&&&         r=   test_compare_matlab TestTukeyHSD.test_compare_matlab  s     ZZ 4 4 6&+--4WV_ 	OOT*	,,. *A!q6A:s1vzqDHHQTNA9I//5qDDIIadOQ:I,,QT2AA !+rK   c                h   Rp\         P                  ! VP                  RR4      P                  4       R,          \        R7      P                  R4      p. RO. RO. RO3p\        P                  ! V!  pVP                  4       pV F  w  rgrr\        V4      ^,
          \        V4      ^,
          rv\        VP                  Wg3,          V	RR7       \        VP                  Wg3,          VRR7       \        VP                  Wg3,          V
R	R7       \        VP                  Wg3,          VRR7       K  	  R
# )a  
Testing against results and p-values from R:
from: https://www.rdocumentation.org/packages/stats/versions/3.6.2/
topics/TukeyHSD
> require(graphics)
> summary(fm1 <- aov(breaks ~ tension, data = warpbreaks))
> TukeyHSD(fm1, "tension", ordered = TRUE)
> plot(TukeyHSD(fm1, "tension"))
Tukey multiple comparisons of means
95% family-wise confidence level
factor levels have been ordered
Fit: aov(formula = breaks ~ tension, data = warpbreaks)
$tension
z
                diff        lwr      upr     p adj
        2 - 3  4.722222 -4.8376022 14.28205 0.4630831
        1 - 3 14.722222  5.1623978 24.28205 0.0014315
        1 - 2 10.000000  0.4401756 19.55982 0.0384598
        r  r  r  rB   rC  rC   rg  h㈵>Nr  )   rZ   6   r  F   4   3   r  C   r  r        r     )      ,   )r     r  r  ru   r  r  rZ   $   *   r  r     '      r  r  r  )r  r     r  rT   +   r  r  r  r  r  r  r  r   r  r  r  r  r  )r6   str_resr  r  r  r  r|   r  r  r  r  r;   s   &           r=   test_compare_rTestTukeyHSD.test_compare_r  s     ZZs ; A A CB G&+--4WV_ 	555	6 OOT*	,,. *A!q6A:s1vzqDHHQTNAD9I//5qtDDIIadOQT:I,,QT2ADA !+rK   c                   . ROp. ROp. ROp. ROp\         P                  ! WW44      pVP                  4       p\        P                  ! . RO. R	O. R
O. RO.4      p\        P                  ! . RO. RO. RO. RO.4      pR FU  w  r\        VP                  W3,          WyV
3,          RR7       \        VP                  W3,          WV
3,          RR7       KW  	  R# )zX
Example sourced from:
https://www.itl.nist.gov/div898/handbook/prc/section4/prc471.htm
r   rC   N)皙@g@333333@gffffff@r  )g @r  g333333@gffffff"@r  )g       @g      %@g333333 @r  r  )r  gffffff@gffffff@gffffff@g@)r   r   r   g      )g(\?r   gq=
ףpgp=
ף?)gGz?r   r   g
ףp=
?)r   r   r   r   )r   r   r   gzG?)gzG@r   g      ?g=
ףp=@)g=
ףp=@r   r   g@)rN   r   )rO   r   )r   rP   r4  r  )r   r  r  r[   r2   r   r  r  )r6   group1group2group3group4rl   r  lowerupperr|   r  s   &          r=   test_engineering_stat_handbook+TestTukeyHSD.test_engineering_stat_handbook  s    
 +*+*ooff=&&(

 	 
 

!	  ?FQDHHQTNEQ$KdCDIIadOUa4[tD ?rK   c                B   \         P                  P                  R 4      pVP                  R4      p\        P                  ! V!  pVP                  4       p\        VP                  VP                  P                  ) 4       \        \         P                  ! VP                  4      VP                  R,          4       \        \         P                  ! VP                  4      VP                  R,          4       \        VP                  VP                  P                  ) 4       \        \         P                  ! VP                  4      ^ 4       \        VP                  VP                  P                  4       \        \         P                  ! VP                  4      ^4       R# )l   ]A N)rP   r   )r   r   )r[   rx   ry   r   r  r  r   r  r  r  diagonalrj   rk   )r6   r{   r  rl   r  s   &    r=   test_rand_symmTestTukeyHSD.test_rand_symm&  s    ii##J/zz(#oot$&&(TXX		|, 	R[[+TYYt_=R[[*DHHTN;S]]S]]__$45R[[/3SZZ.R[[,a0rK   c                    \        \        R R7      ;_uu_ 4        \        P                  ! . RO^\        P
                  .. RO4       RRR4       R#   + '       g   i     R# ; i)z...must be finite.r'   Nr   )rS   rU   rP   )r   r5   r   r  r[   rz   r:  s   &r=   test_no_infTestTukeyHSD.test_no_inf9  s8    :-ABBOOI266{I> CBBBs   -AA"	c                    \        \        R R7      ;_uu_ 4        \        P                  ! ^^.^^..^^.. RO4       RRR4       R#   + '       g   i     R# ; i)z...must be one-dimensionalr'   N)rR      rS   r   r5   r   r  r:  s   &r=   
test_is_1dTestTukeyHSD.test_is_1d=  sA    :-IJJOOaVaV,q!fjA KJJJs   #AA	c                    \        \        R R7      ;_uu_ 4        \        P                  ! . ^^.. RO4       RRR4       R#   + '       g   i     R# ; i)z...must be greater than oner'   N)rQ   rR   rS   r  r:  s   &r=   test_no_emptyTestTukeyHSD.test_no_emptyA  s4    :-JKKOOBA	2 LKKKs   AA	c           	         R p\        \        VR7      ;_uu_ 4        \        P                  ! . RO^^.^^.RR7       RRR4       R#   + '       g   i     R# ; i)z(Expected a boolean value for 'equal_var'r'   False)	equal_varNr   )r   	TypeErrorr   r  )r6   r|  s   & r=   test_equal_var_input_validation,TestTukeyHSD.test_equal_var_input_validationE  s=    89C00OOI1v1vI 1000s   !AA	nargsc                    \        \        R R7      ;_uu_ 4        \        P                  ! . RO.V,          !   RRR4       R#   + '       g   i     R# ; i)z...more than 1 treatment.r'   Nr  rU   rP   r  )r6   r  s   &&r=   test_not_enough_treatments'TestTukeyHSD.test_not_enough_treatmentsJ  s3    :-HIIOOzlU24 JIIIs   AA	clc                    \        \        R R7      ;_uu_ 4        \        P                  ! . RO^^.^	^.4      pVP	                  V4       RRR4       R#   + '       g   i     R# ; i)zmust be between 0 and 1r'   Nr  )r   r5   r   r  r  )r6   r  r  s   && r=   test_conf_level_invalid$TestTukeyHSD.test_conf_level_invalidO  sH    :-FGG
QFQF;A!!"% HGGGs   0AA%	c                6   \         P                  ! V P                  R ,          !  p\         P                  ! V P                  R ,          !  p\	        VP
                  VP
                  R,          4       \	        VP
                  VP
                  R,          4       R# ):NrO   NNr  r  )r   r  data_diff_size	ttest_indr   rk   )r6   r  	res_ttests   &  r=   test_2_args_ttestTestTukeyHSD.test_2_args_ttestU  sj    OOT%8%8%<=	OOT%8%8%<=		(()*:*:4*@A	(()*:*:4*@ArK   r   N)rV       7@ffffff:@皙;@fffff=@)ffffff<@皙A@     =@皙@@皙>@)g:@gL<@gL8@g333333:@g;@)rV  r  gHzG:@r  r	  r
  r  r  )rV  r  r  )
r  r  r  r  r  r  r  r  r  r  )r  unequal sample sizezextreme sample size differencesr  )r  r   rN   rO   )r   r   r   r   data_same_sizer  extreme_sizesas_same_sizesas_diff_sizesas_extremer4   r   r   r  matlab_sm_sizmatlab_diff_szr  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r=   r  r  e  s    4446N H446N '24L
MMK [[7-}dC-}dC+[%@ "E  F#GF#GJMN [[7-}eD-~tDF"5"7"9  :
B:
B*'BRE41&?B3J
 [[Wf-5 .5 [[T>2& 3&
B BrK   r  c                   D  a  ] tR tRt o . RO. RO. RO3t. RO. RO. RO. RO3tRtRt]P                  P                  ]P                  P                  R]]3]]33RR.R7      R 4       4       tR	tR
t]P                  P                  R]]3]]33RR.R7      R 4       tRtV tR# )TestGamesHowelli]  aK  
            Mean Diff      Lower Bound         Upper Bound         Sig
    0 - 1   8.25000000    -16.5492749527311    33.0492749527311    0.558733632413559
    0 - 2  -5.50000000    -63.6702454316458    52.6702454316458    0.941147750599221
    1 - 2  -13.7500000    -74.3174374251372    46.8174374251372    0.682983914946841
    a+  
             Mean Diff       Lower Bound        Upper Bound         Sig
    0 - 1	 28.16666667    -141.985416377670   198.318749711003	0.8727542747886180
    0 - 2	 4.466666667	-37.2830676783904   46.2164010117237	0.9752628408671710
    0 - 3	 16.26666667	-35.0933112382470   67.6266445715803	0.4262506151302880
    1 - 2	-23.70000000	-195.315617201249   147.915617201249	0.9148950609000590
    1 - 3	-11.90000000	-188.105478728519   164.305478728519	0.9861432250093960
    2 - 3	 11.80000000	-16.2894857524254	39.8894857524254    0.4755344436335670
    zdata, res_expect_strr  r  r  c                8   \         P                  ! VP                  RR4      P                  4       R,          \        R7      P                  R^4      p\        P                  ! VRR/ pVP                  4       pV F  w  rgrr\        V4      \        V4      rv\        VP                  Wg3,          VRR7       \        VP                  Wg3,          VRR7       \        VP                  Wg3,          V	R	R7       \        VP                  Wg3,          V
R
R7       K  	  R# )z
DATA LIST LIST /Group (F1.0) Value (F8.2).
BEGIN DATA
0 24
0 23
0 31
0 51
1 34
1 18
1 18
1 26
2 17
2 68
2 59
2 7
END DATA.

ONEWAY Value BY Group
    /MISSING ANALYSIS
    /POSTHOC=GH ALPHA(0.05).
r  r  :rU   NNrB   r  Fg:0yE>rC   rg  r  Nrw   )r[   r2   r  r  r  r  r   r  r  r  r   rj   rk   r  r  )r6   r  r  r  	res_gamesr  r|   r  r  r  r  r;   s   &&&         r=   test_compare_spss!TestGamesHowell.test_compare_spssy  s    8 ZZ""5#.446r: Q 	 OOT;U;	,,. *A!q63q6qI//5qtDI,,QT2ADADHHQTNAD9DIIadOQT: !+rK   z
                  q value             Pr(>|q|)
    1 - 0 == 0   -1.5467805948856344  0.55873362851759
    2 - 0 == 0    0.4726721776628535  0.94114775035993
    2 - 1 == 0    1.246837541297872   0.68298393799782
    aw  
                 q value             Pr(>|q|)
    1 - 0 == 0  -1.0589317485313876  0.87275427357438
    2 - 0 == 0  -0.5716222106144833  0.97526284087419
    3 - 0 == 0  -2.6209678382077000  0.42625067714691
    2 - 1 == 0   0.8971899898179028  0.91489506061850
    3 - 1 == 0   0.4579447210555352  0.98614322544695
    3 - 2 == 0  -2.198800177874794   0.47553444364614
    c                x   \         P                  ! VP                  RR4      P                  RR4      P                  4       R,          \        R7      P                  R^4      p\        P                  ! VRR/ pV F<  w  rV rx\        V4      \        V4      rV\        VP                  We3,          VRR	7       K>  	  R
# )a  
games-howell is provided by PMCMRplus package
https://search.r-project.org/CRAN/refmans/PMCMRplus/html/gamesHowellTest.html
> library("PMCMRplus")
> options(digits=16)
> table = data.frame(
    values = c(24., 23., 31., 51., 34., 18., 18., 26., 17., 68., 59.,  7.),
    groups = c("0", "0", "0", "0", "1", "1", "1", "1", "2", "2", "2", "2")
  )
> table$groups = as.factor(table$groups)
> fit <-aov(values ~ groups, table)
> res = gamesHowellTest(fit)
> summary(res)
r  r  z == :rP   NNrB   r  FrC  rC   Nrw   )r[   r2   r  r  r  r  r   r  r  r   rk   )	r6   r  r  r  r  r  r|   _r;   s	   &&&      r=   r  TestGamesHowell.test_compare_r  s    ( ZZ""5#.WVS!%%'". !Q 	 OOT;U;	 (MA!Qq63q6qI,,QT2ADA (rK   r   N)g      8@r  g      ?@     I@)g      A@      2@r"  g      :@)g      1@g      Q@g     M@g      @)g      >@r  r!  )g     @Tg     Q@g      ;g     O@)g      E@g      &@g      =@g      3@g      I@)r  g      6@r  r"  g      "@)r   r   r   r   r  r  spss_same_sizespss_diff_sizer4   r   r  r   r  r_same_sizer_diff_sizer  r   r   r   s   @r=   r  r  ]  s     ***,N &,/.0N
NN [[[[3,n=+^<>!4!6!8  9
!;9 !;FKK [[3,k:+[9;!4!6!8  9
B9
BrK   r  c                      a  ] tR tRt o ]P
                  P                  R. RO. RO34      R 4       t]P
                  P                  R. RO. RO. RO. RO. RO. RO. RO. RO34      R 4       tR t	R t
R tR	tV tR
# )TestPoissonMeansTesti  zc1, n1, c2, n2, p_expectc                d    \         P                  ! WW44      p\        VP                  VR R7       R# r   r   poisson_means_testr   rk   )r6   c1r   c2r   p_expectrl   s   &&&&&& r=   test_paper_examples(TestPoissonMeansTest.test_paper_examples  s&     &&rr6

H48rK   z c1, n1, c2, n2, p_expect, alt, dc           	     j    \         P                  ! WW4WgR 7      p\        VP                  VRRR7       R# ))r   diffg>r>  rD   ri  Nr*  )	r6   r,  r   r-  r   r.  altdrl   s	   &&&&&&&& r=   test_fortran_authors)TestPoissonMeansTest.test_fortran_authors  s*    $ &&rr3O

H4eDrK   c                l    R R r!R R rC\         P                  ! WW$4      p\        VP                  ^4       R# )r   Nr*  r6   count1count2nobs1nobs2rl   s   &     r=   test_different_results+TestPoissonMeansTest.test_different_results  s2     eu&&vfD

A&rK   c                l    ^ ^ r!^^rC\         P                  ! WW$4      p\        VP                  ^4       R# r:  r*  r9  s   &     r=   test_less_than_zero_lambda_hat24TestPoissonMeansTest.test_less_than_zero_lambda_hat2  s2     A!u&&vfD

A&rK   c           
     
   ^ ^ r!^^rCRp\        \        VR7      ;_uu_ 4        \        P                  ! RW2V4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! WRV4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! RW2V4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! WRV4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! VRW$4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! WVR4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! WW$RR7       RRR4       R	p\        \        VR7      ;_uu_ 4        \        P                  ! ^^^^R
R7       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELg; i  + '       g   i     ELA; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   z`k1` and `k2` must be integers.r'   r   Nz1`k1` and `k2` must be greater than or equal to 0.z%`n1` and `n2` must be greater than 0.z(diff must be greater than or equal to 0.)r2  zAlternative must be one of ...errorr   rw   )r   r  r   r+  r5   )r6   r:  r;  r<  r=  r<   s   &     r=   r   *TestPoissonMeansTest.test_input_validation  s   A!u 49G44$$R> 59G44$$VB> 5 F:W55$$R> 6:W55$$VB> 6 ::W55$$VR? 6:W55$$VFB? 6 =:W55$$VFK 6 3:W55$$Q1aWE 655 544444
 655555
 65555
 65
 655s_   G'G;HH#H7III1'G8	;H	H 	#H4	7I	I	I.	1J	r   N)r   r   rP   r   gea?)rO   r   rS   r   g	c?)r  rT   r  rT   g{}?r   r   )rT   rT   rT   rT   goPF?r   r   )2   r  rN   rN   gae?r   r   )rP   r   r  rA  g/V-=?r   r   )rP   ru   rQ   r  g")?r   r   )rQ   r  rP   r   g_'Qm~?r   r   )rQ   r  rP   rT   g|?r   r   )rN   rN   rF  r  g0ݷ?r   r   )r   r   r   r   r4   r   r   r/  r6  r>  rA  r   r   r   r   s   @r=   r(  r(    s     [[7  : 
9
9 [[?
 	=<=>9; 	66B "E#"E''!F !FrK   r(  c                   X  a  ] tR tRt o R t]P                  P                  R. RO4      R 4       t]P                  P                  R. RO4      R 4       t	]P                  P                  R. RO4      R 4       t
R tR	 t]P                  P                  R
^ ^.4      R 4       tR tRtV tR# )TestBWSTesti*  c           
     j   \         P                  P                  R 4      pVP                  RR7      w  r4VP                  V4      VP                  V4      rCRp\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! W4RR7       RRR4       Rp\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! W4^R7       RRR4       Rp\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! W1P                  . VP                  R	7      4       RRR4       R
p\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! W4RR7       RRR4       Rp\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! W4^*R7       RRR4       R#   + '       g   i     ELH; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)   <ovT{ rp   z"`axis` must be an integer or None.r'   r   rr   Nz7`axis` is not compatible with the shapes of the inputs.z`x` and `y` must contain...rB   zalternative` must be one of...r  r   z!method` must be an instance of...r   rO   rU   )
r[   rx   ry   r2   r4   r   r5   r   bws_testr@   )r6   r7   r{   r8   r9   r<   s   &&    r=   test_bws_input_validation%TestBWSTest.test_bws_input_validation-  s^   ii##$78zzvz&zz!}bjjm16]]:W55NN1c* 6 L]]:W55NN1a( 6 0]]:W55NN1jj177j;< 6 3]]:W55NN1[9 6 6]]:W55NN1+ 65! 655 655 65 65 655s<   ;GG'	2G;)H0H!G$	'G8	;H	H	!H2	r@   Nc                ^   Vf   \        V4      M
\        W!4      pVP                  . ROVR7      pVP                  . ROVR7      p\        P                  ! W4RR7      p\        VP                  VP                  RVR7      RR7       \        VP                  VP                  R	VR7      4       R # )
NrB   r   r   gI+@rM   rC   )rN   rO   rP   rQ   rS   rU   rV   )rR   rv   rT   rt   ru   r   r  gf$/g?)r   rH   r2   r   rL  r   rj   rk   )r6   r@   r7   r8   r9   rl   s   &&&   r=    test_against_published_reference,TestBWSTest.test_against_published_referenceG  s     ). $72;MJJ,EJ:JJ1J?nnQ{;rzz%uz'EDQ

BJJweJ$DErK   c                   \         P                  P                  R 4      pVP                  R
R7      w  rgVP                  WdP                  R7      VP                  WtP                  R7      rv\
        P                  ! WgVR7      pVP                  W$P                  R7      pVP                  W4P                  R7      p\        VP                  VRR7       \        VP                  VRRR7       R	# )rJ  rp   rB   r   vIh%<=rh  r   r   r3  NrK  )
r[   rx   ry   r2   r   r   rL  r   rj   rk   	r6   r   rj   rk   r7   r{   r8   r9   rl   s	   &&&&&    r=   test_against_RTestBWSTest.test_against_RR  s     ii##$78zzvz&zz!::z.

1JJ
0O1nnQ{;JJy

J;	F**5yu=

FDArK   c                n   \         P                  P                  R 4      pVP                  ^	R7      pVP                  ^R7      pVP                  V4      VP                  V4      rv\        P
                  ! WgVR7      pVP                  WdP                  R7      VP                  WtP                  R7      rv\        P
                  ! WgVR7      pVP                  W$P                  R7      pVP                  W4P                  R7      p\        VP                  VRR7       \        VP                  VRRR7       R	# )
l   .sZ rp   r   rB   rS  rh  r   r   r3  N)
r[   rx   ry   r2   r   rL  r   r   rj   rk   rT  s	   &&&&&    r=   test_against_R_imbalanced%TestBWSTest.test_against_R_imbalancedf  s     ii##$78JJAJJJAJzz!}bjjm1nnQ{;zz!::z.

1JJ
0O1nnQ{;JJy

J;	F**5yu=

FDArK   c                   \         P                  P                  R 4      pVP                  RR7      w  r4VP                  V4      VP                  V4      rC\         P                  P                  R 4      p\        P
                  ! ^
VR7      p\        P                  ! W4VR7      pVP                  P                  ^ ,          ^
8X  g   Q h\         P                  P                  R 4      p\        P
                  ! ^
VR7      p\        P                  ! W4VR7      p\        VP                  VP                  4       \         P                  P                  R4      p\        P
                  ! ^
VR7      p\        P                  ! W4VR7      pVP                  VP                  VP                  VP                  ,
          4      R8  4      '       g   Q hR# )   /HN( rp   )n_resamplesr{   r      VC	A r   N)rO   rT   )r[   rx   ry   r2   r   rv  rL  null_distributionr   r   allr&  )	r6   r7   r{   r8   r9   r   r'  r(  rR  s	   &&       r=   test_methodTestBWSTest.test_method}  sO   ii##$78zzwz'zz!}bjjm1ii##$78((RSA~~a62%%++A."444ii##$78((RSA~~a62..0F0FGii##$78((RSA~~a62vvbffT33d6L6LLMPSSTTTTrK   c                   \         P                  P                  R 4      pVP                  VP                  ^R7      4      pVR,
          pVP                  RVP                  R7      pVP                  ^VP                  R7      p\
        P                  ! W4RR7      pVP                  ^ 8  g   Q h\        VP                  V4       \
        P                  ! W4RR7      pVP                  ^ 8  g   Q h\        VP                  V4       \
        P                  ! WCRR7      pVP                  ^ 8  g   Q h\        VP                  V4       \
        P                  ! WCRR7      pVP                  ^ 8  g   Q h\        VP                  V4       R# )	r[  rp   r   rB   r   r   r   NgAAp?)
r[   rx   ry   r2   r   r   rL  rj   r   rk   )r6   r7   r{   r8   r9   pminpmaxrl   s   &&      r=   test_directionsTestBWSTest.test_directions  s%   ii##$78JJszzqz)*Fzz'z4zz!2::z.nnQy9}}q   

D)nnQv6}}q   

D)nnQv6}}q   

D)nnQy9}}q   

D)rK   rs   c                   \         P                  P                  R 4      pVP                  RR7      pVw  rV\        P                  ! VP                  V4      VP                  V4      VR7      p\         P                  ! WA^,           R4      w  rV. . r\        WV4       Fp  w  r\        P                  ! VP                  V
4      VP                  V4      4      pVP                  VP                  4       V	P                  VP                  4       Kr  	  VP                  V4      VP                  V	4      r\        VP                  V4       \        VP                  V	4       R# )r[  rp   rr   N)rO   rP   rR   rw   )r[   rx   ry   r   rL  r2   r@  zipappendrj   rk   r  r   )r6   rs   r7   r{   r   r8   r9   rl   ref_statistic
ref_pvaluex_y_r   s   &&&          r=   test_ndTestBWSTest.test_nd  s    ii##$78JJIJ&nnRZZ]BJJqME{{11fb)$&z!iFB..BB@C  /cjj)   %'HH]$;RXXj=Qz}5

J/rK   c                   \         P                  P                  R 4      pVP                  RR7      w  r4VP                  V4      VP                  V4      rC\        P
                  ! W4RR7      p\        P
                  ! \        V4      \        V4      4      p\        VP                  VP                  4       \        VP                  VP                  4       R# )r]  rp   Nrr   )rO   rO   rP   )
r[   rx   ry   r2   r   rL  r   r   rj   rk   )r6   r7   r{   r8   r9   rl   r   s   &&     r=   test_axis_NoneTestBWSTest.test_axis_None  s    ii##$78zzyz)zz!}bjjm1nnQ-nnXa[(1+6s}}5

CJJ/rK   r   r   )r   rj   rk   ))r   g
-?g4B/?)r   
-g0&v?)r   rs  g(?))r   gD5H?gdԕ?)r   `ч?gȲךX?)r   rt  g4)?)r   r   r   r   rM  r4   r   r   rP  rU  rX  r`  re  rn  rq  r   r   r   s   @r=   rH  rH  *  s     ,4 [[W&BCF DF [[CNOB	OB  [[CNOB	OB&U0*2 [[VaV,0 -0$0 0rK   rH  )>	itertoolsr   numpyr[   r  r4   numpy.testingr   r   r   r   r   scipyr   r	   scipy.statsr
   scipy.stats._hypotestsr   r   r   r   r   r   r   scipy.stats._mannwhitneyur   r   r   scipy._lib._testutilsr   scipy._externalr   r   scipy._lib._array_apir   r   r   r   r   r   scipy._lib._array_api_no_0dr   r   scipy.stats._axis_nan_policyr   r    lazy_xp_modulesr   r  r"   r   r   r  r"  rM  rq  r  r  r(  rL  rH  r   rK   r=   <module>r     s       @ @ *   %4 4 4 E D 2 2B B H R';;//  '(L2 L2 )L2^ 5''(YO YO )YOx 5%%&_
C _
C '_
CDl<" l<^P
 P
fV1 V1r '([4 [4 )[4|uB uBpsB sBrQF QFh 5>>"]0 ]0 #]0rK   