+
    0i^                       R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
Hu Ht ^ RIHt ^RIHt ^ RI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 ^ R	IHt ^ R
I H!t!H"t"  ! R R4      t#R?R lt$R?R lt%] ! R R4      4       t&] ! R R4      4       t' ! R R4      t( ! R R4      t)] ! R R4      4       t*] ! R R4      4       t+ ! R R4      t, ! R R4      t-] ! R R 4      4       t.] ! R! R"4      4       t/R# t0R$ t1 ! R% R&4      t2R' t3R( t4R) t5R* t6] ! R+ R,4      4       t7 ! R- R.4      t8 ! R/ R04      t9 ! R1 R24      t: ! R3 R44      t; ! R5 R64      t< ! R7 R84      t= ! R9 R:4      t>] ! R; R<4      4       t? ! R= R>4      t@R# )@z?
Tests for the stats.mstats module (support for masked arrays)
N)nan)maskednomask)stats)check_named_results)raises)assert_equalassert_almost_equalassert_array_almost_equalassert_array_almost_equal_nulpassert_assert_allcloseassert_array_equal)_mstats_basic	_stats_py)skip_xp_invalid_arg)SmallSampleWarningtoo_small_1d_not_omitc                   &   a  ] tR t^t o R tRtV tR# )TestMquantilesc                    \         P                  ! . RO. RO. RO. RO. RO. RO. R	O. R
O. RO. RO. RO.4      p. RO. RO. RO.p\        P                  ! V^ RR7      p\	        W24       R# )      @)axislimitN)r         @      ?)g     G@      .@       @)g     H@      B@      @)r        C@      @)      E@      D@     8)     D@r%   r$   )r   r$   r$   )r    r$   r$   )g     E@r$   r$   )r#   r$   r$   )r   r$   r$   )g3333333@g333333-@g333333?)r#   g     B@      @)gffffffE@gfffffD@gffffff@)    2   )nparraymstats
mquantilesr	   )selfdatadesiredquantss   &   a/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/stats/tests/test_mstats_basic.pytest_mquantiles_limit_keyword,TestMquantiles.test_mquantiles_limit_keyword   se    xx'''**+,,,,
. 
/ &$&( ""4aw?F,     N)__name__
__module____qualname____firstlineno__r2   __static_attributes____classdictcell____classdict__s   @r1   r   r      s     - -r4   r   c                 |    \         P                  ! WVR 7      p\        WQVR7       \        VP                  V4       R# )r   dtypertolN)r+   gmeanr   r   r@   
array_liker/   r   r@   rB   xs   &&&&& r1   check_equal_gmeanrG   .   s*    Z%8AAT*% r4   c                 |    \         P                  ! WVR 7      p\        WQVR7       \        VP                  V4       R# r?   )r   hmeanr   r   r@   rD   s   &&&&& r1   check_equal_hmeanrJ   5   s*    J7AAT*% r4   c                      a  ] tR t^;t o R tR tR tR tR t]	P                  P                  ]! ]R4      '       * RR7      R	 4       tR
 tRtV tR# )TestGeoMeanc                V    . ROp\         P                  ! ^R4      p\        WRR7       R# )   +=rA   NrN                  ?)r)   powerrG   r-   ar/   s   &  r1   test_1dTestGeoMean.test_1d=   s!    ((7E*!51r4   c                    \         P                  ! . RO4      pRp\        W4       \         P                  ! . RO. ROR7      p\        P                  ! ^R	4      p\        WRR7       R# )

   gsŤF@maskrO   rA   N
r[         (   r(   <   F   P   Z   d   rP   r'   r'   r'   rN   UUUUUU?)mar*   rG   r)   rU   rV   s   &  r1   
test_1d_maTestGeoMean.test_1d_maB   sH    HH>?!%HH\5((5%(!51r4   c                j    \         P                  P                  . RO. ROR7      pRp\        W4       R# )r[   r\   gdq_D@Nr^   
r'   r'   r'   r'   r'   r'   r'   r'   r'   rN   r)   ri   r*   rG   rV   s   &  r1   test_1d_ma_valueTestGeoMean.test_1d_ma_valueL   s,    EEKKA;  =!%r4   c                b    \         P                  P                  . RO4      p^ p\        W4       R# )r[   N)
r[   r_   r`   ra   r(   rb   rc   rd   re   r'   rn   rV   s   &  r1   test_1d_ma0TestGeoMean.test_1d_ma0S   s"    EEKK?@!%r4   c                    \         P                  P                  . RO4      p\         P                  p\         P                  ! RR7      ;_uu_ 4        \        W4       RRR4       R#   + '       g   i     R# ; i)r[   ignore)invalidN)
r[   r_   r`   ra   r(   rb   rc   rd   re   )r)   ri   r*   r   errstaterG   rV   s   &  r1   test_1d_ma_infTestGeoMean.test_1d_ma_infY   sD    EEKK@A&&[[**a) +***s   A''A8	float96cannot find float96 so skippingreasonc                    \         P                  ! . RO. ROR7      p\        P                  ! ^R4      P	                  \        P
                  4      p\        W\        P
                  RR7       R# )rN   r\   rO   )r@   rB   NrP   rg   rh   )ri   r*   r)   rU   astyper{   rG   r-   rW   
desired_dts   &  r1   test_1d_float96TestGeoMean.test_1d_float96`   sC     HH\5XXeU+222::>
!rzzFr4   c                   \         P                  ! . RO. RO. RO.. RO. RO. R	O.R7      p\        P                  ! . RO4      p\        W^ RR7       \         P                  ! \        P                  ! ^R
4      \        P                  ! ^R4      \        P                  ! ^R4      .4      p\        WRRR7       . RO. RO. RO.pRp\        \        P                   P                  V4      V4       R# )rN   r\   rO   r   rB   g/,$qJ@NrP   r'   r'   r'   r'   rN   r'   r'   rN   r'   rN   rN   r'   rT         ?rw   r[   r_   r`   ra   r(   rb   rc   rd   re   rf   n   x   )ri   r*   r)   rG   rU   rV   s   &  r1   
test_2d_maTestGeoMean.test_2d_mag   s    HHlL,?'|DF((<(!159((BHHWe4HHS%0HHS%02 3 	!2E: /1DE"%%++a.'2r4   r5   N)r6   r7   r8   r9   rX   rj   ro   rr   ry   pytestmarkskipifhasattrr)   r   r   r:   r;   r<   s   @r1   rL   rL   ;   sc     2
2&&* [[GB	22@  BGBG
3 3r4   rL   c                      a  ] tR t^xt o R t]P                  P                  ]! ]	R4      '       * RR7      R 4       t
R tRtV tR# )	TestHarMeanc                   \         P                  ! . RO. ROR7      pR	p\        WRR7       \        P                   P                  . R
O4      pRp\        W4       \        P                   P                  . R
O. ROR7      pRp\        W4       R# )rN   r\   rO   rA   g=b#A@gO?@NrP   rg   /袋.?r^   rm   ri   r*   rJ   r)   rV   s   &  r1   rX   TestHarMean.test_1dz   sk    HH\5+!51EEKKAB!%EEKKA;  =!%r4   r{   r|   r}   c                    \         P                  ! . RO. ROR7      p\        P                  ! R\        P                  R7      p\        W\        P                  R7       R# )rN   r\   r@   NrP   rg   r   )ri   r*   r)   asarrayr{   rJ   r   s   &  r1   r   TestHarMean.test_1d_float96   s7     HH\5ZZ 9L
!rzz:r4   c                6   \         P                  ! . RO. RO. RO.. RO. RO. R	O.R7      p\         P                  ! . RO4      p\        W^ RR7       . R
Op\        WRRR7       . RO. RO. RO.pRp\        \        P                   P                  V4      V4       R# )rN   r\   rO   r   gmWUC@NrP   r   r   r   )gQ?g433333@g?rw   r   r   r   r   rV   s   &  r1   test_2dTestHarMean.test_2d   sx    HHlL,?'|DF((<(!159L!2E:/1DE"%%++a.'2r4   r5   N)r6   r7   r8   r9   rX   r   r   r   r   r)   r   r   r:   r;   r<   s   @r1   r   r   x   sM     & [[GB	22@  B;B;
3 3r4   r   c                   &   a  ] tR t^t o R tRtV tR# )TestRankingc                   \         P                  ! . RO4      p\        \        P                  ! V4      . RO4       \
        V^^.&   \        \        P                  ! V4      . RO4       \        \        P                  ! VRR7      . RO4       \         P                  ! . R	O4      p\        \        P                  ! V4      . R
O4       \         P                  ! . RO. RO.4      p\        \        P                  ! V4      . RO. RO.4       \        \        P                  ! V^R7      . RO. RO.4       \        \        P                  ! V^ R7      . RO. RO.4       R# )r'   T)use_missingr   N)
r'   rN   rN   rN   rQ   rR   rS      r      )
rN   rR   rR   rR   r   r            !@r   r[   )
rN   r&   r&   r'   r'   rS   r         @r      )
rN   r&   r&         @r   rS   r   r   r   r   )
r'   rN   r   rN   rQ   rS   rR   r   rN   r   )
rN   rR   r   rR   r   r   r   r   rR   r[   )r'   rN   rN   rN   rQ   )rR   rS   r   r   r   )rN   rR   rR   rR   r   )r   r   r   r   r[   )rN   rQ         @r   r   rN   rN   rN   rN   rN   rQ   rQ   rQ   rQ   rQ   )ri   r*   r	   r+   rankdatar   r-   rF   s   & r1   test_rankingTestRanking.test_ranking   s    HH+,FOOA.6	81Q%FOOA.9	;FOOA4@=	?HH+,FOOA.6	8HHk<01FOOA.(*:;	=FOOAA6(/:	<FOOA15(,7	9r4   r5   N)r6   r7   r8   r9   r   r:   r;   r<   s   @r1   r   r      s     9 9r4   r   c                     a  ] tR t^t o R tR tR tR t]P                  P                  ]P                  ! 4       R8H  RR7      R 4       t]P                  P                  ]P                  ! 4       R8H  RR7      ]P                  P                  R	 4       4       tR
 t]P                  P#                  RR4      ]P                  P#                  RR4      R 4       4       tR t]P                  P(                  R 4       t]R 4       tRtV tR# )TestCorrc                D   \         P                  ! ^
4      p\        P                  ! 4       ;_uu_ 4        \        P                  ! R\
        4       \        \        P                  ! W4      ^ ,          R4       \        \        P                  ! WRRR1,          4      ^ ,          R4       \         P                  ! VRR7      p\        P                  ! W4      p\        V^ ,          \        J 4       \        V^,          \        J 4       RRR4       \         P                  ! . RO4      p\         P                  ! . R	O4      p\        P                  ! W44      w  rV\        V\        P                  ! ^4      ^,          4       \        VR
4       . ROp\         P                  ! . ROVR7      p\         P                  ! . ROVR7      p	\        P                  ! W4      w  rV\        V\        P                  ! ^4      ^,          4       \        VR
4       R#   + '       g   i     EL; i)r[   errorr   NTr\   rw         )r           r   )r'   r'   rR   rh   )FFFT)r   r   r   g     X@)r'   r'   rR   rw   )ri   arangewarningscatch_warningssimplefilterRuntimeWarningr	   r+   pearsonrr*   r   r   r)   sqrt)
r-   rF   prx1y1rpr]   x2y2s
   &         r1   test_pearsonrTestCorr.test_pearsonr   s^   IIbM$$&& !!'>: 5a 8#>TrT7 ;A >E&A&BBqEVO$BqEVO$ ' XX&'XXi r&Arwwqz!|,Au% +XX,48XXm$/r&Arwwqz!|,Au%5 '&&s   CHH	c                   \         P                  P                  . RO. ROR7      p\         P                  P                  . RO. ROR7      p\         P                  ! . RO4      p\         P                  ! . RO4      p\        P
                  ! W4      w  rV\        P
                  ! W44      w  rx\        WW4       \        Wh4       R# )	rN   r\   NrN   rQ   rR   rS   r   r   )r'   rN   r'   r'   r'   r'   )	   r   r   r   r   r   )r'   r'   rN   r'   r'   r'   )rN   rS   r   r   )r   r   r   r   )r)   ri   masked_arrayr*   r+   r   r   r   )	r-   mxmyrF   ymrmpr   r   s	   &        r1   test_pearsonr_misaligned_mask&TestCorr.test_pearsonr_misaligned_mask   s    UU 29KLUU 29KLHH\"HH\"(~~a#RRr4   c                X   . R)O. R*Or!\        \        P                  ! W4      ^ ,          R+4       R RRR\        P                  .RRRR\        P                  .r!\
        P                  ! V4      \
        P                  ! V4      r!\        \        P                  ! W4      ^ ,          R+4       . R,Op. R-Op\        \        P                  ! W4      ^ ,          R 4       RRR	R
RRRRRRRRRRR\        P                  .pRRRRRRRRRRRRRRR\        P                  .p\
        P                  ! V4      \
        P                  ! V4      r!\        \        P                  ! W4      ^ ,          R 4       \        \        R!4      4      p\        \        R!4      4      pV^	,          V^ ,          uV^ &   V^	&   VR",          V^
,          uV^
&   VR"&   VR#,          VR$,          uVR$&   VR#&   \        \        P                  ! W4      ^ ,          R%4       \        P                  ! W4      pR.p\        W4R&R'7       R(# )/333333@      @Gz	@HzG@ffffff?Q@@r   33333G@r"   皙%@N@333333?      P@̌O@r   ffffff?皙@333333?333333@@皙6@皙 @333333F@'@皙8@333333?@D@r   ffffff@333333?gI
?  i  i  i  gV-?Tri   N)r   r   r   r   )r   r   r   r   gIQ=俩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   correlationpvalue)
r	   r+   	spearmanrr)   r   ri   fix_invalidlistranger   r-   rF   r   res
attributess   &    r1   test_spearmanrTestCorr.test_spearmanr   s   ')>AF,,Q1!4jAT$rvv.T$tBFF/KA..#R^^A%6AF,,Q1!4jA00F,,Q1!4i@$dD#tT#sCc383dD#sD#sCc38..#R^^A%6AF,,Q1!4i@
 ttqT1Q4
!ad#""qvD'1S6#$ 	F,,Q1!4e< q$.
C5r4   c                   . ROp. ROpRp\         P                  ! W4      w  rE\        WC4       \        VR4       \         P                  ! WRR7      w  rE\        WC4       \        VR4       \         P                  ! WRR7      w  rE\        WC4       \        VR4       \        P                  P                  R4      p^dp\        P                  ! ^ ^V4      pR	V,          VP	                  V4      ,           p\         P                  ! W4      w  r\         P                  ! WRR7      w  r\        W^,          4       \         P                  ! WRR7      w  r\        V^V	^,          ,
          4       Yu;8X  d	   V8X  g   Q h Q h\        P                  ! \        R
R7      ;_uu_ 4        \         P                  ! WRR7       RRR4       R#   + '       g   i     R# ; i)r   g+;
?gr?greateralternativegb?lessgcH}?l   MBy 皙?zalternative must be 'less'...matchz	ekki-ekkiNr   r   )
r+   r   r   r)   randomdefault_rnglinspacer   r   
ValueError)r-   rF   r   r_expr   r   rngnstat1p1stat2p2stat3p3s   &             r1   test_spearmanr_alternative#TestCorr.test_spearmanr_alternative  sm   00 #%!,-)<!,-&9!?+ ii##J/KK1a ECJJqM!$$Q*	$$QyA	F#$$Qv>	AQJ'&&&&&&]]:-LMMQ{; NMMMs   #GG	ppc64lezfails/crashes on ppc64ler}   c                	   \         P                  ! \        P                  ! . RO4      4      p\         P                  ! \        P                  ! . RO4      4      pRR.p\        \        P                  ! \
        P                  ! W4      4      V4       \         P                  ! \        P                  ! ^
4      4      p\         P                  ! \        P                  ! ^
4      4      pRR.p\        \        P                  ! \
        P                  ! W4      4      V4       \        \        \
        P                  WRR7       V^,          pV^,          V^&   WB^&   RR.p\        \        P                  ! \
        P                  ! W4      4      V4       V^,          pV^,          V^&   WB^&   RR	.p\        \        P                  ! \
        P                  ! W4      4      V4       \         P                  ! \        P                  ! ^
4      4      p\         P                  ! \        P                  ! ^
4      R
R
R1,          4      pRR.p\        \        P                  ! \
        P                  ! W4      4      V4       V^,          pV^,          V^&   WB^&   R R.p\        \        P                  ! \
        P                  ! W4      4      V4       V^,          pV^,          V^&   WB^&   R!R	.p\        \        P                  ! \
        P                  ! W4      4      V4       \         P                  ! RRRR\        P                  .4      p\         P                  ! RRR"R\        P                  .4      p\         P                  ! RRRR\        P                  .4      p\        \        P                  ! \
        P                  ! W4      4      RR.4       \        \        P                  ! \
        P                  ! WRR7      4      RR.4       \        \        P                  ! \
        P                  ! W4      4      R#R.4       \         P                  ! ^ ^ ^ ^ ^^^ ^<^ ^^
^
^ ^(^ ^^ ^ ^ ^ ^ \        P                  .4      p\         P                  ! ^ ^P^P^P^
^!^<^ ^C^^^P^P^P^P^P^P^ ^
^-\        P                  ^ .4      p\
        P                  ! W4      p\        \        P                  ! V4      R$R.4       R%p\        WgRR7       R
# )&r   r   r   gxO~>bananamethodg?>?gaV>g}'}'?go&5>Nr   r   r   r   r   g     :@gףp=
@r   r   g1UU?      ?
asymptoticglgN?gQM?gvPwTk?Tr   )r   rQ   r   r   )rS   r   r      rw   r   g?>g}'}'gQg~ȋgXJĿr   )ri   r*   r)   r	   r   r+   
kendalltaur   assert_raisesr  r   r   r   )r-   rF   r   expectedbzresultr  s   &       r1   test_kendalltauTestCorr.test_kendalltau1  s    HHRXXl+,HHRXXm,- :BJJv'8'8'>?J HHRYYr]#HHRYYr]# +,BJJv'8'8'>?J 	j&"3"3Q(K aDt!! '(:;BJJv'8'8'>?J aDt!! '(:;BJJv'8'8'>?J HHRYYr]#HHRYYr]4R4() ,-BJJv'8'8'>?J aDt!! ();<BJJv'8'8'>?J aDt!! ();<BJJv'8'8'>?J NND$dBFF;<NND$tRVV<=NND$dBFF;<BJJv'8'8'>?'.	0BJJv'8'8l'ST'3	5BJJv'8'8'>?'3	5 NNAq!QB2q"Ar1b!Q1aI JNNAr2r2r2q"bBBB2r2661N O""1(BJJv.Y0GH /
F48r4   c                d   \         P                  ! R \        R7      p\        P                  ! VR4      p\         P                  ! R \        R7      p\         P
                  ! VR,          VR,          34      p\        \         P                  ! \        P                  ! W4      ^,          4      4       R# )r   r   i  :i  NN:Ni  NN)
r)   r   floatri   masked_greaterconcatenater   isfiniter+   r#  )r-   rF   r   s   &  r1   test_kendalltau_largeTestCorr.test_kendalltau_large  sr     IId%(a&IId%(NNAeHah/0F--a3A678r4   c                p   \         \         ^^^^^^^^^^^.. RO^^^^^^^	^^\         ^^\         .\         ^^^^\         ^^^^^^^..p\        P                  ! V4      P                  p\        P
                  ! V4      p\        VR,          R^4       \        VR,          P                  ^4      . RO4       R# )rS   zglobal p-value (indep)gMb?zseasonal p-valueNrS   rR   r   rR   rQ   r   rR   rN   rN   rQ   rR   r   rR   )g
ףp=
?g(\?皙?g{Gz?)r   ri   r   Tr+   kendalltau_seasonalr	   round)r-   rF   outputs   &  r1   test_kendalltau_seasonal!TestCorr.test_kendalltau_seasonal  s    31b"aAq!Q:4Aq"aAq#q!S91b!RaAq!Q:< NN1++A.F#;<eQGF#56<<Q?1	3r4   r  r  c                X   \         P                  P                  R 4      p^2pVP                  V4      pVP                  V4      pVP                  V4      R8  p\        P                  ! WWR7      p\        P                  ! WgR7      p	\
        P                  ! WWR7      p
VP                  4       pV	P                  4       p\        P                  ! WWR7      p\         P                  WW&   \         P                  Wg&   \        P                  ! WVVRVR7      p\        W4       \        W4       R# )l   iL r   r\   )r  r  omit)r  
nan_policyr  N)r)   r  r  ri   r*   r+   r#  
compressedr   r   r   )r-   r  r  r  r  rF   r   r]   x_maskedy_masked
res_maskedx_compressedy_compressedres_compressedres_nans   &&&            r1   test_kendalltau_mstats_vs_stats(TestCorr.test_kendalltau_mstats_vs_stats  s     ii##J/JJqMJJqMzz!}s"88A)88A)&&vH
  **,**,))vP &&&&""FM 	
30r4   c                    RRR	RR
RRRRRRRRRRR/pVP                  4        F5  w  r#\        P                  ! V^ ,          V^,          4      p\        WC4       K7  	  R# )rf   g遣m?g:4W?g,
:H r   gK?g(6?N)rf   iY	  )e   i	  )   r'   )   r'   )rK  rN   )   rN   )   iE&  )   i%  itemsr   _kendall_p_exactr	   r-   expectationsncr%  r   s   &    r1   test_kendall_p_exact_medium$TestCorr.test_kendall_p_exact_medium  sr     $%;#%; "8 # "8 ##%;#%;= )..0LB00A1>C. 1r4   c                    RRR	RR
RRRRRRR/pVP                  4        F5  w  r#\        P                  ! V^ ,          V^,          4      p\        WC4       K7  	  R# )  gE?gU`Ux<?gve?gZ?g=?gG?N)rX  i5  )i  i\  )i   idd )i!  ih )i@  i 	 )iA  i 	 rO  rR  s   &    r1   test_kendall_p_exact_large#TestCorr.test_kendall_p_exact_large  si     %&<$&<%'=%'=&(>&(>@ )..0LB00A1>C. 1r4   c                   . ^N^ N^N^N^N^N^ N^N^ N^ N^ N^N^N^ N^ N^ N^N^N^N^ N^ N^ N^ N^ N^ N^ N^ N^N^ N^ N^ N^ N^ N^NR"N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\         P                  Np\        \        P                  ! W4      ^ ,          R^4       \        P                  ! W4      pR#p\        W4RR 7       R!# )$rN   g-@g+@g(@g333333$@gffffff@gffffff@g333333@gffffff@g333333@r   ffffff
@g	@r   ffffff@r&   g333333@gffffff@g @r   g      ?g?r   g?皙?gffffff?r   r   r4  r	  g/"?Tr   Nrw   r   )r)   r   r	   r+   pointbiserialrr   r   s   &    r1   test_pointbiserialTestCorr.test_pointbiserial  s   
5Q 5 51 5a 5 5A 5q 5! 5Q 5 51 5a 5 5A 5q 5! 5Q 5 51 5a 5 5A 5555555 5"#5%&5()5+,5./5135BT B4 B Bt BS B# Bs BC B Bc B3 B BBBBB!$B&)B+.B03B58B:=B?BBDGBILBBBBB!$B&)B+.B03B58B:<&&B 	F11!7:GQG ##A).
C5r4   r5   N)exactr!  	two-sidedr  r  )r6   r7   r8   r9   r   r   r  r  r   r   r   platformmachiner)  slowr0  r9  parametrizerF  rU  xslowrY  r   r`  r:   r;   r<   s   @r1   r   r      s$    &>$6L,<\ [[((*i79  ;T9;T9l [[((*i79  ;[[9 ;9
3 [[X'>?[[],LM1 N @1:/ [[/ / 6	 6r4   r   c                   V   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V tR# )TestTrimmingi  c                   \         P                  ! ^
4      p\        \        P                  ! V4      . RO4       \         P                  ! ^
4      p\        \        P                  ! VR4      . RO4       \         P                  ! ^
4      p\        \        P                  ! VRR	R7      . R
O4       \         P                  ! ^
4      p\        \        P                  ! VRRR7      . RO4       \         P                  ! ^4      p\
        ;V^ R.&   V^&   \        \        P                  ! VR4      . RO4       \         P                  ! ^d4      P                  ^
^
4      p^.^
,          ^ .^F,          ,           ^.^,          ,           p\        P                  ! VRRRR7      p\        VP                  P                  4       V4       \        P                  ! VRR^ R7      p\        VP                  P                  4       V4       \        P                  ! VRRRR7      p\        VP                  P                  P                  4       V4       \         P                  ! ^n4      P                  ^^
4      p\
        V^&   ^.^,          ^ .^F,          ,           ^.^,          ,           p\        P                  ! VRRRR7      p\        VP                  P                  4       V4       \        P                  ! VRR^ R7      p\        VP                  P                  4       V4       \        P                  ! VP                  RRRR7      p\        VP                  P                  P                  4       V4       R# )r[   Nlimits	inclusiveT)rn  relative)rp  r   
r'   rN   rQ   rR   rS   r   r   r   r   r   )rQ   r   )
NNrQ   rR   rS   r   r   r   r   NFF)
NNNrR   rS   r   r   r   NN)r	  r4  )
NrN   rQ   rR   rS   r   r   r   NNrw   )NNrQ   rR   rS   Nr   r   r   NNN)
ri   r   r   r+   trimr   reshape_maskravelr5  )r-   rW   rF   r%  trimxs   &    r1   	test_trimTestTrimming.test_trim  s`   IIbMV[[^%:;IIbMV[[5)+IJIIbMV[[%-H9	;IIbMV[[)TB3	5 IIbM!!1R&	AaDV[[E*K	M IIcN""2r*3r6QCF?aSV+Ay4dCU[[&&((3Ay4a@U[[&&((3Ay4bAU[[]]((*H5 IIcN""2r*!3r6QCF?aSV+Ay4dCU[[&&((3Ay4a@U[[&&((3ACCTCUWW]]((*H5r4   c                   \         P                  ! ^d4      p\        \        P                  ! V4      P                  4       ^<4       \        \        P                  ! VRR7      P                  4       ^P4       \        VR&   \        P                  ! V4      p\        VP                  4       ^04       \        VP                  ^.^,          ^ .^",          ,           ^.^,          ,           ^ .^,          ,           ^.^,          ,           4       \        Vn        VP                  R4      p\        \        P                  ! V4      P                  4       ^<4       \        \        P                  ! V4      P                  4       ^P4       R# )rf   r   )tail:r(   rc   NN)r[   r[   )ri   r   r   r+   trimbothcounttrimtailr   ru  r   rt  )r-   rF   rw  s   &  r1   test_trim_oldTestTrimming.test_trim_old  s    IIcNV__Q'--/4V__QC0668"=%"U[[]B'U[[1#b&A3r6/QCF":aSV"Cqc"f"LMIIgV__Q'--/4V__Q'--/4r4   c                    \         P                  ! ^
4      p\        P                  ! VRRR7      p\         P                  ! . RO. ROR7      p\        W#4       \        VP                  VP                  4       R# )r[   rm  r\   N)g333333?gQ?rr  rq  )
rN   rN   r'   r'   r'   r'   r'   r'   r'   rN   )ri   r   r+   trimrr*   r   r]   )r-   rF   r(  r%  s   &   r1   
test_trimrTestTrimming.test_trimr%  sP    IIbMaO88:!?AV&V[[(--0r4   c                   \         P                  ! . RO4      p\        \        P                  ! VR4      R^ 4       \        \        P                  ! VR4      R^ 4       \        \        P                  ! VR4      R^ 4       R# )M   r	  iW  i  Nr  W   X   r                  i  i(  i+  i2  ix  i  i  i  i  i3
  )r	  r	  r4  r4  )ri   r*   r	   r+   trimmed_meanr-   r.   s   & r1   test_trimmedmeanTestTrimming.test_trimmedmean-  sb    xx @ AF//S93BF//Y?aHF//Y?aHr4   c                &   \         P                  P                  R 4      pVP                  ^R7      p\         P                  ! V4      p\        P
                  ! V. ROR7      p\        \        P                  ! VR4      VP                  4       4       R# )l   l{f0j sizer\   r	  NrN   rN   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   r'   rN   rN   )
r)   r  r  sortri   r*   r   r+   trimmed_varvarr-   r  	data_origr.   s   &   r1   test_trimmedvarTestTrimming.test_trimmedvar4  k     ii##$78JJBJ'	wwy!xx $B C**9c:DHHJGr4   c                &   \         P                  P                  R 4      pVP                  ^R7      p\         P                  ! V4      p\        P
                  ! V. ROR7      p\        \        P                  ! VR4      VP                  4       4       R# )l   /{Gzi r  r\   r	  Nr  )
r)   r  r  r  ri   r*   r   r+   trimmed_stdstdr  s   &   r1   test_trimmedstdTestTrimming.test_trimmedstd>  r  r4   c                    \         P                  ! . RO4      p\        \        P                  ! VR4      R^4       \        \        P                  ! VR4      R^4       R# )r  r4  g>L@Nr  r  )ri   r*   r	   r+   trimmed_stder  s   & r1   test_trimmed_stdeTestTrimming.test_trimmed_stdeH  sI    xx @ AF//Y?1MF//S98QGr4   c                ~   \         P                  ! . RO4      p\        \        P                  ! VR4      P                  ^R7      R^4       \        \        P                  ! VRR4      P                  ^R7      R^4       \        V^&   \        P                  ! V4      p\        VP                  VP                  4       R# )r  ddofg@gffff7@Nr  r  rr  )	ri   r*   r	   r+   	winsorizer  r   r   r]   )r-   r.   
winsorizeds   &  r1   test_winsorizationTestTrimming.test_winsorizationN  s    xx @ AF,,T)<@@a@H#Q	(T9];??Q?GQ	 Q%%d+
Z__dii0r4   c           
        \         P                  ! \        P                  \        P                  ^ ^^.4      p\	        \
        \        P                  VRRR7       \        \        P                  ! VR4      \         P                  ! . RO4      4       \        \        P                  ! VR4      \         P                  ! \        P                  \        P                  \        P                  \        P                  \        P                  .4      4       \        \        P                  ! VRRR7      \         P                  ! \        P                  \        P                  ^^^.4      4       \        \        P                  ! VRRR7      \         P                  ! \        P                  \        P                  ^^^.4      4       R# )	r'   raise)r=  r<  N)皙?r  )皙?r  r   )r^  r^  )	ri   r*   r)   r   r$  r  r+   r  r   r  s   & r1   test_winsorization_nan#TestTrimming.test_winsorization_nanZ  s   xxAq12j&"2"2D,!(	* 	V%%dJ7XXo.	0V%%dJ7XXrvvrvvrvvrvvrvvFG	IV%%dJ6JXXrvvrvvq!Q78	:V%%dJ6JXXrvvrvvq!Q78	:r4   r5   N)r6   r7   r8   r9   rx  r  r  r  r  r  r  r  r  r:   r;   r<   s   @r1   rk  rk    s<     #6J51IHHH
1: :r4   rk  c                   D  a  ] tR tRt o . ROt]P                  ! RRRRR]P                  .4      t	]P                  ! ]P                  ! . RO. RO. RO. RO. RO.4      ]P                  ! . RO. RO. RO. RO. RO.]R7      R7      tRR	R
R	/R ltR tR tR tR tR tRtV tR	# )TestMomentsii  gp=
ף?g?߾?gD9?gQI?r   r\   shapeNr@   c                   \         P                  ! V4      pVe   \         P                  ! W#4      p\        W4       Vf   VP                  pVP                  V8X  g   Q hR # N)r)   r   broadcast_tor   r@   )r-   actualexpectr  r@   s   &&&$$r1   _assert_equalTestMoments._assert_equal  sL    F#__V3F6*=LLE||u$$$r4   c                   \         P                  ! V P                  ^4      p\        VR^
4       \         P                  ! V P                  ^4      p\        VR4       \         P                  ! V P                  ^4      p\        VR4       \         P                  ! V P                  ^4      p\        VR4       \         P                  ! V P                  . RO4      p\	        V. RO4       \         P                  ! V P                  R4      p\	        VR4       \        \        \         P                  V P                  R4       \         P                  ! V P                  . RO4      p\	        V. RO4       \         P                  ! . 4      pV P                  V\        P                  \        P                  R7       \         P                  ! \        P                  ! . \        P                  R7      4      pV P                  V\        P                  \        P                  R7       \         P                  ! \        P                  ! R4      ^ R7      pV P                  V. R\        P                  R7       \         P                  ! . .^R7      pV P                  V\        P                  R\        P                  R7       \         P                  ! . .^ ^.^ R	7      pV P                  V. RR
7       \        P                  ! R4      p\        P                  V^	&   \        \         P                  ! V^4      \         P"                  4       R# )rN   r         ?     @r   r   r   r   )r  r@   )momentr   )r  g      $@NrP   )r'   r  r'   r  )r   rQ   rR   r!   )rN   r'   )r'   )rN   )rQ   r'   )r+   r  testcaser	   r   r$  r  r  r)   r   float64r*   float32zerosr   r   ri   r   )r-   r   rF   s   &  r1   test_momentTestMoments.test_moment  s   MM$--*Ac"%MM$--*Ad#MM$--*Ac"MM$--*Af% MM$--6/0 MM$---3j&--DMM$--)9:/0 MM"1bffBJJ7MM"((2RZZ891bffBJJ7MM"((6*31bBJJ?MM2$Q'1bffD

CMM2$1vA61b/IIcNvv!V]]1a("))4r4   c                `    \         P                  ! V P                  4      p\        VR ^
4       R# )%?N)r+   	variationr  r	   )r-   r   s   & r1   test_variationTestMoments.test_variation  s#    T]]+A.3r4   c                ~    \         P                  ! . RO4      p\        P                  ! V^R7      p\	        VR4       R# )rN   r  g<<'?N)rN   rQ   rR   rS   r   )r)   r*   r+   r  r	   )r-   rW   r   s   &  r1   test_variation_ddofTestMoments.test_variation_ddof  s/     HH_%QQ'A12r4   c                   \         P                  ! V P                  4      p\        VR^
4       \         P                  ! V P                  ^ R7      p\        VR^
4       \         P                  ! V P                  4      p\        VR^
4       \
        P                  ! \        P                  ! . R	O4      \        P                  ! . R
O\        R7      R7      p\        \         P                  ! V P                  ^4      V4       \        V P                  4       F+  w  r4\        \         P                  ! V4      W#,          4       K-  	  \
        P                  ! \        P                  ! . RO4      \        P                  ! . R
O\        R7      R7      p\        \         P                  ! V P                  ^RR7      V4       \        V P                  4       F-  w  r4\        \         P                  ! VRR7      WS,          4       K/  	  \        \         P                  ! V P                  R,          4      \        P                  ! V P                  R,          4      4       R# )g7l*?biasr   Fr   r\   Ng7l*ҿg2۠ۿ)gҽr?r'   g>HÛe?r'   gIǮFFFTF)g`٨?r   gn?r'   g0rQ   NNN)r+   skewtestmathworksr	   r  ri   r*   r)   boolr   testcase_2d	enumerater   r-   r   
correct_2dirowcorrect_2d_bias_correcteds   &     r1   test_skewnessTestMoments.test_skewness  s   KK**+A/3KK**2A04KK&Ac"% XXHH / 0<DI


 	D$4$4a8*E 0 01FAC 0*-@ 2 %'HHHH , -<DI%
!
 	D$4$4aeD1	3 0 01FACe < 9 <> 2
 	D$4$4T$:;

4#3#3D#9:	<r4   c                   \         P                  ! V P                  ^ ^ ^R7      p\        VR^
4       \         P                  ! V P                  ^ ^ R7      p\        VR^
4       \         P                  ! V P                  ^ ^ 4      p\        VR4       \
        P                  ! \        P                  ! . RO4      \        P                  ! . RO\        R7      R7      p\        \         P                  ! V P                  ^4      V4       \        V P                  4       F+  w  r4\        \         P                  ! V4      W#,          4       K-  	  \
        P                  ! \        P                  ! . RO4      \        P                  ! . RO\        R7      R7      p\        \         P                  ! V P                  ^RR7      V4       \        V P                  4       F-  w  r4\        \         P                  ! VRR7      WS,          4       K/  	  \        \         P                  ! V P                  R,          4      \        P                  ! V P                  R,          4      ^R	7       R
# )r'   )fisherr  gO߻S@gx|N@g=
ףp=?Fr   r\   r  )nulpN)            g'@=r   gt
Qr  )r  r  g?<r   g`@7r  )r+   kurtosisr  r	   r  ri   r*   r)   r  r
   r  r  r   r   r  s   &     r1   test_kurtosisTestMoments.test_kurtosis  s    OOD..!!DA3
 OOD..qqAA0"5OODMM1a0At$ XXbhh (8 9#%88 -4;?$AB
 	"&//$2B2BA"F",	. 0 01FA 4jmD 2 %'HHHHIJ<DI%K! 	"&//$2B2BA7<#>";	=   0 01FA% @ 9 <> 2
 	'vt7G7G7M'N',~~d6F6Ft6L'M,-	/r4   r5   rP   g}?5^I)gq2۪?g{!3?gr!fa?gk?gY?)gSH*:/?g#R/?g>y}zd?gV߯<?gF?)ggˠw?gyZf?g=?g!@Vyȧ?g#1?)geY(9?gD$?g;?gJX<q0?g#d?)g?gA]?g_.?g?g2^9?)TFFTF)TTTFT)FFFFF)TTTTT)FFTFF)r6   r7   r8   r9   r  ri   r   r)   r   r  r*   r  r  r  r  r  r  r  r  r:   r;   r<   s   @r1   r  r  i  s      HNNE6667$&FF$, -M((
NNNNM	O 	P
 XX86:59	; CG	H
IK%T % %#5J43<B%/ %/r4   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestModei  c                    . ROp\         P                  ! VR4      p\         P                  ! . RO4      p\         P                  ! VR4      p\        P                  ! \        P                  ! V4      ^8  V4      p\        P                  ! V^8  V4      p\        P                  ! V^8  V4      p\        P                  ! \        P                  ! V4      ^8  V4      p\        \        P                  ! VRR7      R	4       \        \        P                  ! V^ R7      R	4       \        \        P                  ! VRR7      R
4       \        \        P                  ! VRR7      R	4       \        \        P                  ! VRR7      R
4       \        \        P                  ! VRR7      R4       \        \        P                  ! VRR7      R4       \        \        P                  ! V^ R7      . RO.. RO.34       \        \        P                  ! V^ R7      . RO.. RO.34       \        \        P                  ! VRR7      ^ .^.^..^.^.^..34       \        \        P                  ! VRR7      ^ .^.^ ..^.^.^ ..34       \        \        P                  ! V^ R7      ^^..^^..34       \        \        P                  ! VRR7      ^.^.^..^.^.^..34       \        P                  ! VRR7      p	Rp
\        WRR7       R# )r'   Nr   Tr   )r'   r'   r'   rN   rN   rN   rQ   rR   rR   rR   rR   rS   r   r   r   )rR   r   r   rR   rQ   )rR   rS   )r'   rR   )rN   rN   )rQ   rN   )r'   r'   r'   rN   rN   r   rw   )moder}  )	r)   rt  r*   ri   masked_wherer   r+   r  r   )r-   a1a2a3a4ma1ma2ma3ma4a1_resr  s   &          r1   	test_modeTestMode.test_mode  sC   ,ZZE"XXm$ZZE"oobhhrlQ.3oob1fb)oob1fb)oobhhrlQ.3V[[$/7V[[!,e4V[[40%8V[[$/7V[[40%8V[[$/7V[[40%8V[[!,}{m.LMV[[1-}/MNV[["-!aS!QC}/MNV[[2.1#qc1#!aS!0NOV[[1-!A1Q%/ABV[[2.1#qc1#!aS!0NORd+ '
F48r4   c                    \         P                  ! R4      pVR;;,          ^,          uu&   VR;;,          ^,          uu&   VP                  4       p\        P                  ! VR4       \        W4       R# )rf   N)rf   rf   )Nr(   Nr  )r  r  )r)   r  copyr+   r  r   )r-   imcps   &  r1   test_mode_modifies_input!TestMode.test_mode_modifies_input!  sM     XXj!
6
a

6
a
WWYBRr4   r5   N)r6   r7   r8   r9   r  r  r:   r;   r<   s   @r1   r  r    s     9: r4   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestPercentilei,  c                <    . ROV n         . ROV n        . ROV n        R# )rR   N)rR   rS   r   r[   r   )rR   r   r   rS   rQ   rN   )r   rS   r   r[   r  r	  r
  r   r  r  r  r-   s   &r1   setup_methodTestPercentile.setup_method-  s    *,1r4   c                   \         P                  ! ^4      R,          p\        \        P                  ! V^ 4      R4       \        \        P                  ! V^d4      R4       \        \        P                  ! V^24      R4       R# )r   r   r   r   g      ?N)r)   r   r   r+   scoreatpercentiler   s   & r1   test_percentileTestPercentile.test_percentile2  sY    IIaL3V--a3R8V--a5s;V--a4d;r4   c                    \         P                  ! . RO. RO. RO. RO. RO.4      p\        \        P                  ! V^24      . RO4       R# )rN   NrN   rN   rN   )rS   rS   rR   )ri   r*   r   r+   r  r   s   & r1   test_2DTestPercentile.test_2D8  s<    HHi	! "
 	V--a4i@r4   r  N)	r6   r7   r8   r9   r  r  r  r:   r;   r<   s   @r1   r  r  ,  s     2
<A Ar4   r  c                   x   a  ] tR tRt o Rt]P                  ! ^^^^]P                  .4      t	R t
R tR tRtV tR# )TestVariabilityiA  zLComparison numbers are found using R v.1.5.1
note that length(testcase) = 4
c                z   \         P                  ! V P                  4      p\        VR 4       V P                  P	                  4       p\        \         P                  ! V P                  ^ R7      \        P                  ! W"^,
          ,          4      ,          \         P                  ! V P                  ^R7      4       R# )g㝎?r  N)r+   semr  r	   r}  r   r)   r   )r-   r   r  s   &  r1   test_semTestVariability.test_semH  so    JJt}}%A|,MM!

4==q9BGGAsG<LL

4==q9	;r4   c                    \         P                  ! V P                  V P                  4      p. ROp\        VVP                  VP
                  R8H  ,          ^R7       R# )OT\w?FdecimalN)OT\w%ܿr  r  )r+   zmapr  r
   r.   r]   )r-   r   desired_unmaskedvalss   &  r1   	test_zmapTestVariability.test_zmapP  sG     KKt}}5!D!"6"#&&5"92	Gr4   c                    \         P                  ! V P                  4      p\        P                  ! RRRR \
        P                  .4      p\        W!^R7       R# )r  r  r   Nr"  r#  )r+   zscorer  ri   r   r)   r   r	   )r-   r   r/   s   &  r1   test_zscoreTestVariability.test_zscoreY  sF     MM$--(.."24E"2ORVV"M NG3r4   r5   N)r6   r7   r8   r9   __doc__ri   r   r)   r   r  r  r&  r*  r:   r;   r<   s   @r1   r  r  A  s>      ~~q1Qrvv./H;G4 4r4   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestMiscib  c                   ^.^,          ^.^,          ,           ^.^	,          ,           ^.^,          ,           ^	.^,          ,           ^
.^,          ,           ^.^.^,          ,           ^.^,          ,           ^	.^	,          ,           ^
.^,          ,           .p^R.,          ^R.,          ,           ^	R.,          ,           ^R.,          ,           ^R.,          ,           ^R.,          ,           R.^R.,          ,           ^R	.,          ,           ^	R
.,          ,           ^R.,          ,           .p\        \        P                  ! \        P                  ! V!  P
                  ^4      V^4       R# )r   g_v	@g1%?g"u?gZӼ?g!u @gq&@g;pΈ$@gTR'p@g9#?gHPx?gQI?N)r	   r)   r7  r+   obrientransformr5  )r-   argsr(  s   &  r1   test_obrientransformTestMisc.test_obrientransforme  s   Aqc"faSU"A3q5(!Q.tAv5QCE	1#a%A%rd2g-/VH*R[(F83AvhJ>q&zI!WI+U)AvhJ&q&z1!VH*<R[HJBHHV%;%;T%B%D%DaH"A	'r4   c                4   \         \         ^^^^^^^^^^^.. RO^^^^^^^	^^\         ^^\         .\         ^^^^\         ^^^^^^^..p\        P                  ! V4      P                  pVP                  w  r#rE\	        \
        P                  ! \        P                  ! W#4      ^4      R4       \	        \
        P                  ! \        P                  ! W#R4      ^4      R4       \	        \
        P                  ! \        P                  ! W#R4      ^4      R4       R# )rS   glNr3  )48E?gsA?)g%䃞?g 	?)r7  g46<?)	r   ri   r   r5  r	   r)   r7  r+   ks_2samp)r-   rF   winterspringsummerfalls   &     r1   test_ks_2sampTestMisc.test_ks_2sampm  s    #q!RQ1aAq94Aq"aAq#q!S91b!RaAq!Q:< NN1)*&BHHV__V%DaH,	.BHHV__VS%I1M,	.BHHV__VS%I1M,	.r4   c                   . RO. R	O. R
O3p\         P                  ! V!  p\        V^ ,          R^4       \        V^,          R^4       \        \        ^^^^^^^^^^^.. RO^^^^^^^	^^\        ^^\        .\        ^^^^\        ^^^^^^^..p\        P
                  ! V4      p\         P                  ! V!  p\        V^ ,          R^4       \        V^,          R^4       Rp\        W$RR7       \        P                  P                  pV! . RO4      V! . RO4      V! . RO4      V! . RO4      .pV! . RO4      V! . RO4      V! . RO4      V! . RO4      .p\        \         P                  ! V!  R4       \        \         P                  ! V!  R4       \        \        \         P                  V^ ,          V^,          4       R# )      "@g:pΈ$@g(QGu?gr @g-C6?Tr   N)
r@        #@      @      @rA  rC         @r   r   r   )
r   r   r   rC  rB  rD  r   r   r   r   )
r   rD  r!   r   r   r   r   r!   r   r   r3  	statisticr   )g"~j?g^I+?gI+?gjt?gMbX9?gʡE?x&?-?g?r   gGz?g+?gv?g9v?)g~jt?gx?gOn?rG  g"~j?n?gK7A`?rH  g7A`?r   bX9?gZd;O?g1Zd?gK?)gy&1?gzG?g`"?g!rh?g'1Z?gZd;O?grh|?gjt?gʡE?r   gzG?gS?gJ4?gʡE?)gK7?gh|?5?gl?g/$?g#~j?rI  gQ?g      ?g      ?r   rJ  g rh?g333333?g
ףp=
?)r   g#@r   gffffff@g$@)g333333@r   g@r   g@)g@gffffff@g      @r]  g @)g!@g!@g333333 @r\  g333333"@)gNt$@gBv?)g\(\%@g+ԋ?)r+   friedmanchisquarer	   r   ri   r   r   r)   r   r
   r$  r  )r-   r1  r(  rF   r  r*   r   x3s   &       r1   test_friedmanchisqTestMisc.test_friedmanchisq|  s   999; ))40F1Iw2F1Ix3#q!RQ1aAq94Aq"aAqa371b!RQ1aAq9; NN1))1-F1Ivq1F1Ivq1 -
F48  C D D E E F D EF& ./-.-.-.0 	"&":":B"?"H	J 	"&":":B"?"=	?j&":":BqE2a5Ir4   r5   N)	r6   r7   r8   r9   r2  r=  rM  r:   r;   r<   s   @r1   r.  r.  b  s     '.:J :Jr4   r.  c                  N   \         P                  ! ^ ^d^d4      p R\         P                  ! ^ ^d^d4      ,          ^
,           pV\         P                  ! \         P                  ! ^ ^^d4      4      ,          p\        P                  ! W4      p\
        P                  p\        \        W#4      4       R
p\        W$RR7       R\        V4      9   g   Q h\        VP                  R4       \        VP                  R4       \        VP                  R4       \        VP                  R4       R	# )r'   r4  Tr   intercept_stderrg5E%?g +l$@g4_Qc?g8?N)slope	interceptrvaluer   stderr)r)   r  sinr+   
linregressr   LinregressResultr   
isinstancer   dirr	   rQ  rR  rT  rP  )rF   r   r(  lrr  s        r1   test_regress_simpler[    s    
AsC Abkk!S#&&+AAr3'	((Aq$F 
	#	#BJv"#EJt4V,,, &9:((*<=';<//1DEr4   c                  .   \         P                  P                  R 4      p \         P                  ! ^
4      pV P                  ^
4      pRp\	        \
        VR7      ;_uu_ 4        \        P                  ! W4       RRR4       R#   + '       g   i     R# ; i)l   B8k:E zBCannot calculate a linear regression if all x values are identicalr
  N)r)   r  r  r  r$  r  r+   rV  )r  rF   r   msgs       r1   test_linregress_identical_xr^    s_    
))


,C
A

2A
NC	z	-	-! 
.	-	-	-s   "BB	c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestTheilslopesi  c                4   \         P                  ! . RO4      w  rr4\        VR4       \        VR4       \         P                  ! . RORR7      w  rr4\        VR4       \        VR4       \        P                  P                  . RO. ROR7      p\         P                  ! V4      w  rr4\        VR4       \        VR4       \         P                  ! VRR7      w  rr4\        VR4       \        VR4       . ROp. ROp\         P                  ! WVR4      w  rr4\        V^4       \        VR4       \        VR^R	7       \        VR
^R	7       \         P                  ! WVRRR7      w  rr4\        V^4       \        VR4       \        VR^R	7       \        VR
^R	7       R# )r'   r   jointr  r   r\   gQ?r!   gQ@r   gGz@r   N)r'   rN   rN   )r'   rN   rf   rN   )FFTFrh   gUUUUUU?)rN   rQ   rR   rS   r[         )r         r_   -   7   N   )r+   theilslopesr	   r)   ri   r*   )r-   rQ  rR  lowerupperr   rF   s   &      r1   test_theilslopes TestTheilslopes.test_theilslopes  sc   )/););I)F&%E3'Is+)/););ICJ*L&%E3'Is+ EEKK-HKI)/););A)>&%E4(It,)/););ACJ*L&%E4(Is+ %')/););A$)G&%E1%Is+E43E43)/););A$CJ*L&%E1%Is+E43E43r4   c           	     `   R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! ^ ^.^ ^ .4      p\
        P                  ! \
        P                  ! V4      4      '       g   Q h RRR4       \        P                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       \        P                  ! . RO. RO4      p\        V^ ^ \
        P                  \
        P                  34       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zEAll `x` coordinates.*|Mean of empty slice|invalid value encountered.*r
  Nru   zinvalid value encountered...r'   r'   r'   )r'   rN   r'   )r   warnsr   r+   rj  r)   allisnanr   r   filterwarningsr   r   )r-   r]  r   s   &  r1   test_theilslopes_warnings)TestTheilslopes.test_theilslopes_warnings   s    U\\.44$$aVaV4C66"((3-(((( 5 $$&&##8.J$$Y	:CC!Q!78	 '& 54 '&&s   AD	A$D	D	D-	c                   . ROp. ROp\         P                  ! W4      w  r4rV\         P                  ! W4      p\        W7P                  4       \        WGP                  4       \        WWP
                  4       \        WgP                  4       R# )z^
Simple test to ensure tuple backwards-compatibility of the returned
TheilslopesResult object
NrN   rQ   rS   rS   r   r   )r+   rj  r   rQ  rR  	low_slope
high_slope)r-   r   rF   rQ  rR  rz  r{  r(  s   &       r1   'test_theilslopes_namedtuple_consistency7TestTheilslopes.test_theilslopes_namedtuple_consistency  sk    
 282D2DQ2J/)##A) 	ULL)Y 0 01Y 0 01Z!2!23r4   c                
   \         P                  P                  R 4      pVP                  ^ ^^
\         P                  R7      p\
        P                  ! W"4      p\         P                  P                  VP                  ^4       R# )l   U5<H )r  r@   N)
r)   r  r  integersuint8r   rj  testingr   rQ  )r-   r  r   r   s   &   r1   test_gh19678_uint8"TestTheilslopes.test_gh19678_uint8  s[     ii##$45LLCbL9%


""399a0r4   r5   N)
r6   r7   r8   r9   rm  ru  r|  r  r:   r;   r<   s   @r1   r`  r`    s     $4N
94 1 1r4   r`  c                     ^\         P                  ! ^
4      ,          R,           p \        \        P                  ! V 4      R4       \        \        P                  ! V RR7      R4       ^\         P                  ! ^
4      ,          p^V,          R,
          p \        \        P                  ! W4      R4       \        \        P                  ! WRR7      R4       RV R&   \        \        P                  ! W4      R4       \         P                  ! ^
4      pRRV,          ,           \
        P                  P                  ^
^R7      ,           p \
        P                  ! W4      w  r#  p\        P                  ! W4      w  rV\        WRR	R
7       \        WcR	R
7       \        P                  ! WRR7      w  rV\        WRR	R
7       \        WcR	R
7       R# )rQ   r   separater  r     :NrS   Nr   r  random_stater	  rA   N)r   r   )rB  r  gffffff)
r)   r   r   r+   siegelslopesr   normrvsrV  r   )r   rF   	slope_olsintercept_ols_rQ  rR  s          r1   test_siegelslopesr  &  sK   	BIIbMCA$$Q'4$$Qz:JG	BIIbMA	AA$$Q*K8$$Q*={K AbE$$Q*K8 			"As1uuzz~~2C~@@A(-(8(8(>%IaA**10EE3/I37**1
CEE3/I37r4   c                     . ROp . ROp\         P                  ! W4      w  r#\         P                  ! W4      p\        W$P                  4       \        W4P                  4       R# )z`
Simple test to ensure tuple backwards-compatibility of the returned
SiegelslopesResult object.
Nrx  ry  )r+   r  r   rQ  rR  )r   rF   rQ  rR  r(  s        r1   (test_siegelslopes_namedtuple_consistencyr  C  sM    
 	AA**10E  &F %,,-r4   c            
         \         P                  P                  R 4      p V P                  RR7      p\        P                  ! V4      w  r#R p\        ^4       F8  p\        \         P                  ! V! VRV3,          4      4      W%,          4       K:  	  \         P                  ! \        VP                  ^,          4       Uu. uF  qT! VRV3,          4      NK  	  up4      p\        \         P                  ! V4      V4       R# u upi )l   ,'  r  c                 P   \        V 4      p\        P                  ! V4      pW R \        P                  3,          ,
          pW"R \        P                  3,          ,
          p\        P                  ! \        P
                  ! W3\        R7      ^R7      pW5,          WE,          ,          # )r  r   )k)lenr)   r   newaxistriuonesr  )yir  rF   dydxr]   s   &     r1   dijk&test_sen_seasonal_slopes.<locals>.dijkX  sn    GIIaLQ

]##1bjj=!!wwrwwvT2a8x  r4   r  N)rf   rS   )
r)   r  r  r+   sen_seasonal_slopesr   r   medianr.  r  )r  rF   intra_slopeinter_sloper  r  
all_slopess          r1   test_sen_seasonal_slopesr  R  s    
))

 3
4C


!A%99!<K! 1X		$qAw-0+.A  aggaj8I J8I1a1g8I JKJBIIj);7 !Ks   Dc                      \         P                  ! \        P                  ! ^4      ^ ^ 4      p \	        V P
                  \        P                  ! . RO4      4       R# )rR   N)rT   r   r   )r+   plotting_positionsr)   r   r
   r.   r*   )poss    r1   test_plotting_positionsr  g  s6    

#
#BIIaL!Q
7Cchh1B(CDr4   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
]P                  P                  R	R
R.4      ]P                  P                  RRR.4      R 4       4       tR tRtV tR# )TestNormalitytestsim  c                   \         P                  ! R4      ^,          p\        \        P                  ! V4      \
        P                  ! V4      4       \        \        P                  ! V4      \
        P                  ! V4      4       \        \        P                  ! V4      \
        P                  ! V4      4       \
        P                  \
        P                  \
        P                  .p\        P                  \        P                  \        P                  .p. ROp\        W#4       F  w  rE\        P                  ! \        \        R7      ;_uu_ 4        V! V4      p\         P                  ! VP                  4      '       g   Q h\         P                  ! VP                  4      '       g   Q h RRR4       \!        \"        WQ4       K  	  R#   + '       g   i     L&; i)rQ   r
  Nr  rw   r'   rN   rQ   rR   r  rw   r'   rN   rQ   rR   r  rw   r'   rN   rQ   rR   r  rw   r'   rN   rQ   rR   rP   )r)   r*   r
   r+   
normaltestr   skewtestkurtosistestzipr   rq  r   r   rs  rF  r   r$  r  )r-   rF   funcsmfuncsfuncmfuncr   s   &      r1   test_vs_nonmasked$TestNormalitytests.test_vs_nonmaskedp  s2   HH+,a/!&"3"3A"6"'"2"21"5	7!&//!"4"'.."3	5!&"5"5a"8"'"4"4Q"7	9 !!5>>53E3EF##V__f6I6IJu-KD08MNN1gxx....xx

++++ O *e/ .NNs   AG+GGc                   \         P                  ! R4      ^,          p\        \        P                  ! VRR7      \        P                  ! V4      4       \        \        P
                  ! VRR7      \        P
                  ! V4      4       \        \        P                  ! VRR7      \        P                  ! V4      4       R# )rQ   Nr   r  )r)   r*   r   r+   r  r  r  r   s   & r1   test_axis_None!TestNormalitytests.test_axis_None  s{    HH&'*))!$79J9J19MN5vq7IJ++AD9++A.	0r4   c                Z   \         P                  ! R4      ^,          p\         P                  P                  \         P                  \         P                  V^
3,          \         P                  RR.VP
                  ,          R3,          R7      p\        \        P                  ! V4      \        P                  ! V4      4       \        \        P                  ! V4      \        P                  ! V4      4       \        \        P                  ! V4      \        P                  ! V4      4       R# )rQ   TFr\   Nr  )r)   r*   ri   r_infr  r   r+   r  r   r  r  )r-   rF   xms   &  r1   test_maskedarray_input)TestNormalitytests.test_maskedarray_input  s    HH+,a/UU[[rvvq"}- eeD5'AFF*:D$@A  C))"-u/?/?/BC+U^^A->?++B/1C1CA1FGr4   c                   \         P                  ! R4      ^,          p\         P                  ! V.^,          4      P                  p\        P
                  \        P                  \        P                  3 FW  pV! V4      pV! V4      p\        V^ ,          V^ ,          .^,          4       \        V^,          V^,          .^,          4       KY  	  R# )rQ   Nr  )	r)   r*   vstackr5  r+   r  r  r  r   )r-   rF   x_2dr  res_1dres_2ds   &     r1   test_nd_input TestNormalitytests.test_nd_input  s    HH+,a/yy!q!##&&9L9LMD!WF$ZFF1Iq	{Q7F1Iq	{Q7	 Nr4   c                    \         P                  ! R4      ^,          p\        P                  ! V4      pRp\	        W#RR7       R# rQ   Tr   Nr  rE  )r)   r*   r+   r  r   r-   rF   r   r  s   &   r1   !test_normaltest_result_attributes4TestNormalitytests.test_normaltest_result_attributes  s5    HH+,a/",
C5r4   c                    \         P                  ! R4      ^,          p\        P                  ! V4      pRp\	        W#RR7       R# r  )r)   r*   r+   r  r   r  s   &   r1   #test_kurtosistest_result_attributes6TestNormalitytests.test_kurtosistest_result_attributes  s5    HH+,a/!!!$,
C5r4   c           
         . ROp\         P                  ! \        V4       UUu. uF  w  r#\         P                  ! W24      NK  	  upp4      p\	        \
        P                  ! V4      ^,          R8  R4       R# u uppi )   g{Gz?TN)
r  r'   :   r   r'   )      r'   r'      )r)   hstackr  fullr   r+   r  )r-   countsr  crF   s   &    r1   test_regression_9033'TestNormalitytests.test_regression_9033  s\     7II61BC1Brwwq}1BCDV((+A.5t< Ds   !A8
testr  r  r  r  r  c                   \         P                  P                  ^
R^^{R7      p\        \         V4      p\        \        V4      pV! W2R7      w  rgV! W2R7      w  r\        WRR7       \        WRR7       \        P                  VR&   \        P                  P                  V\        P                  ! V4      R7      pV! VP                  4       VR7      w  rgV! W2R7      w  r\        WRR7       \        WRR7       R# )	r[   r&   locscaler  r  r  g-q=atol:rN   r   Nr\   N)r   r  r  getattrr+   r   r)   r   ri   r   rs  r>  )
r-   r  r  rF   
stats_testmstats_testz_exp_exr'  r   s
   &&&       r1   test_alternative#TestNormalitytests.test_alternative  s     JJNNr2CNHUD)
fd+;
16e,e, #EEqrxx{3KH
16e,e,r4   c                   \         P                  P                  ^^{R7      pRp\        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! VRR7       RRR4       \        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! VRR7       RRR4       R#   + '       g   i     LW; i  + '       g   i     R# ; i)r_   r  z`alternative` must be...r
  r   r  N)	r   r  r  r   r   r  r+   r  r  )r-   rF   r]  s   &  r1   test_bad_alternative'TestNormalitytests.test_bad_alternative  s    JJNNN5)]]:S11OOA73 2 ]]:S11w7 21 21 211s   B0C0C 	C	r5   N)r6   r7   r8   r9   r  r  r  r  r  r  r  r   r   rh  r  r  r:   r;   r<   s   @r1   r  r  m  s}     0&0H866= [[Vj.%AB[[]VY,?@- A C-&8 8r4   r  c                   &   a  ] tR tRt o R tRtV tR# )TestFOnewayi  c                    \         P                  ! R R.\         P                  R7      p\         P                  ! RR.\         P                  R7      p\        P                  ! W4      pRp\        W4RR7       R# )	i  i  r   i  i  Tr   NrE  )r)   r*   uint16r+   f_onewayr   )r-   rW   r&  r   r  s   &    r1   test_result_attributes"TestFOneway.test_result_attributes  sO    HHc3Zryy1HHc3Zryy1ooa#,
C5r4   r5   Nr6   r7   r8   r9   r  r:   r;   r<   s   @r1   r  r    s     6 6r4   r  c                     a  ] tR tRt o ]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      t]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      tR tR t	Rt
V tR# )	TestMannwhitneyui  r   r   r   c                z    \         P                  ! V P                  V P                  4      pRp\	        WRR7       R# )rF  Tr   NrE  )r+   mannwhitneyurF   r   r   )r-   r   r  s   &  r1   r  'TestMannwhitneyu.test_result_attributes  s+    !!$&&$&&1,
C5r4   c                ,   \         P                  ! V P                  V P                  4      p\        P                  ! V P                  V P                  4      pVP
                  VP
                  8X  g   Q h\        VP                  VP                  4       R # r  )r+   r  rF   r   r   rF  r   r   )r-   res1res2s   &  r1   test_against_stats#TestMannwhitneyu.test_against_stats   s`     ""4664662!!$&&$&&1~~///T[[1r4   r5   N)r6   r7   r8   r9   r)   r*   rF   r   r  r  r:   r;   r<   s   @r1   r  r    s    
 *" *b *" *b *" *b *" *b *" *b *" *b *" *b **** *"$*&(**,*.0*24*68*:<*>@*BD*FH**** *"$*&(**,*.0*24*68*:<*>@*BD*FH* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* 	* 	* 	* !	* #%	* ')	* +-	* /1	* 35	* 79	* ;=	* ?A	* CE	* GI	*
 *
 *
 *
 !*
 #%*
 ')*
 +-*
 /1*
 35*
 79*
 ;=*
 ?A*
 CE*
 GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI* * * * !* #%* ')* +-* /1* 35* 79* ;=* ?A* CE* GI*  !*  !*  !*  !!*  #%!*  ')!*  +-!*  /1!*  35!*  79!*  ;=!*  ?A!*  CE!*  GI!*" #*" #*" #*" !#*" #%#*" ')#* 	+A& 	 "" "b "" "b "" "b "" "b "" "b "" "b "" "b """" ""$"&("*,".0"24"68":<">@"BD"FH"""" ""$"&("*,".0"24"68":<">@"BD"FH" " " " !" #%" ')" +-" /1" 35" 79" ;=" ?A" CE" GI" 	" 	" 	" !	" #%	" ')	" +-	" /1	" 35	" 79	" ;=	" ?A	" CE	" GI	"
 "
 "
 "
 !"
 #%"
 ')"
 +-"
 /1"
 35"
 79"
 ;="
 ?A"
 CE"
 GI" " " " !" #%" ')" +-" /1" 35" 79" ;=" ?A" CE" GI" " " " !" #%" ')" +-" /1" 35" 79" ;=" ?A" CE" GI" " " " !" #%" ')" +-" /1" 35" 79" ;=" ?A" CE" GI" " " " !" #%" ')" +-" /1" 35" 79" ;=" ?A" CE" GI" " " " !" #%" ')" +-" /1" 35" 79" ;=" ?A" CE" GI" " " " !" 	#A6
2 2r4   r  c                   &   a  ] tR tRt o R tRtV tR# )TestKruskali
  c                `    . ROp. ROp\         P                  ! W4      pRp\        W4RR7       R# )rN   Tr   N)rN   rR   r   r   r   )rQ   rS   r   r   r[   rE  )r+   kruskalr   r   s   &    r1   r  "TestKruskal.test_result_attributes  s)    nnQ",
C5r4   r5   Nr  r<   s   @r1   r  r  
  s     6 6r4   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]P                  P                  R
RR.4      R 4       tRtV tR# )TestTtest_reli  c                N    \         P                  P                  R 4      V n        R# )l   6Gk] Nr)   r  r  r  r  s   &r1   r  TestTtest_rel.setup_method      99((4r4   c                   V P                   P                  R4      . RO,           p\        P                  ! VR,          VR,          4      p\        P                  ! VR,          VR,          4      p\        W#4       \        P                  ! VR,          VR,          RR7      p\        P                  ! VR,          VR,          RR7      p\        W#4       \        P                  ! VR,          VR,          ^ R7      p\        P                  ! VR,          VR,          ^ R7      p\        W#4       \        P                  ! VR,          VR,          4      p\        W44       R# )	r_   Nr   r_   rS   r'   r'   rN   rQ   r  r'   r  rN   r  :NrQ   Nr  :rQ   NN)r  standard_normalr   	ttest_relr+   r   )r-   outcomer  r  res3s   &    r1   r  TestTtest_rel.test_vs_nonmasked  s    ((**73lB wt}gdm<wt}=# wt}gdm$Gwt}4H#wu~wu~AFQG# ?#r4   c                n   \         P                  ! V P                  P                  R4      . RO. R	O.R7      p\        P
                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       VR
,          VR,          3\        P                  \        P                  .RR.33 Fm  p\        P                  ! V!  w  r4\        V\        P                  \        P                  34       \        V\        P                  \        P                  34       Ko  	  RRR4       R#   + '       g   i     R# ; irR   r\   ru   %invalid value encountered in absoluter   r   Nr  r  rp  r  r  )ri   r   r  r  r   r   rt  r   r)   r   r+   r  r   r-   r  pairtr   s   &    r1   test_fully_maskedTestTtest_rel.test_fully_masked-      //$((":":6"B(19'=?$$&&##A>S!$-766266*S#J79''."1rvvrvv&67"1rvvrvv&67	9 '&&&   CD##D4	c                    V P                   P                  R4      . RO,           p\        P                  ! VR,          VR,          4      pRp\	        W#RR7       R# 	r_   Tr   Nr	  r
  r  r  rE  )r  r  r+   r  r   r-   r  r   r  s   &   r1   r  $TestTtest_rel.test_result_attributes9  D    ((**73lBwt}gdm<,
C5r4   c           
        \        \        \        P                  \        P
                  ! ^
4      \        P
                  ! ^4      4       \        P
                  ! ^4      p\        \        \        P                  VP                  ^^^4      VP                  ^^^4      ^R7       \        \        \        P                  VP                  ^^^4      VP                  ^^^4      ^R7       R# )r[   r   N)r$  r  r+   r  r)   r   rt  r   s   & r1   test_invalid_input_size%TestTtest_rel.test_invalid_input_size@  s    j&"2"2iimRYYr]	4IIbMj&"2"2ii1a(!))Aq!*<1	Fj&"2"2ii1a(!))Aq!*<1	Fr4   c                    \         P                  ! . . 4      p\        \        P                  ! \        P
                  ! V4      4      4       R # r  )r+   r  r   r)   rr  rs  r-   r  s   & r1   
test_emptyTestTtest_rel.test_emptyI  -    B'rxx~&'r4   c           	        \         P                  ! . RO. RO4      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        P                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       \         P                  ! . RO. RO4      w  r\        V\        P                  ! \        P                  \        P                  .4      4       \        V\        P                  ! \        P                  \        P                  .4      4       RRR4       R#   + '       g   i     R# ; i)r'   ru   r  Nrp  r  )r+   	ttest_indr   r)   absr  r   r   rt  r   r   r*   r   r-   r  r   s   &  r1   test_zero_division TestTtest_rel.test_zero_divisionM  s    	95bffQi^bffa[1$$&&##A>S##Iy9DAq"((BFFBFF+;"<=q"((BFFBFF+;"<= '&&&s   -B6D--D>	c                    R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! . RO. RORR7       RRR4       R#   + '       g   i     R# ; i4alternative must be 'less', 'greater' or 'two-sided'r
  foor  NrN   rQ   rR   )rS   r   r   r   r   r  r+   r,  r-   r]  s   & r1   r  "TestTtest_rel.test_bad_alternativeX  9    E]]:S11Y	uE 2111   AA 	r  r  r  c                $   \         P                  P                  ^
^^^*R7      p\         P                  P                  ^^^^*R7      p\         P                  ! W#VR7      w  rE\        P                  ! W#VR7      w  rg\        WdRR7       \        WuRR7       \        P                  VR&   \        P                  VR&   \        P                  P                  V\        P                  ! V4      R7      p\        P                  P                  V\        P                  ! V4      R7      p\        P                  ! W#VR7      w  rg\         P                  ! VP                  4       VP                  4       VR7      w  rE\        WdRR7       \        WuRR7       R# r[   r  r  rO   rA   rN   r[   Nr\   N)r   r  r  r  r+   r   r)   r   ri   r   rs  r>  r-   r  rF   r   t_exr  r  r   s   &&      r1   r  TestTtest_rel.test_alternative]  s   JJNNr"NEJJNNqND__Q{C
+>e,e, &&$&&$EEqrxx{3EEqrxx{3+>__Q\\^Q\\^1<>
e,e,r4   r  N)r6   r7   r8   r9   r  r  r  r  r$  r(  r/  r  r   r   rh  r  r:   r;   r<   s   @r1   r  r    sZ     5$(
86F(	>F
 [[]VY,?@- A-r4   r  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
]P                  P                  R	R
R.4      R 4       tRtV tR# )TestTtest_indis  c                N    \         P                  P                  R 4      V n        R# )l   };[9 Nr  r  s   &r1   r  TestTtest_ind.setup_methodt  r  r4   c                    V P                   P                  R4      . RO,           p\        P                  ! VR,          VR	,          4      p\        P                  ! VR,          VR	,          4      p\        W#4       \        P                  ! VR,          VR	,          RR7      p\        P                  ! VR,          VR	,          RR7      p\        W#4       \        P                  ! VR
,          VR,          ^ R7      p\        P                  ! VR
,          VR,          ^ R7      p\        W#4       \        P                  ! VR
,          VR,          4      p\        W44       \        P                  ! VR,          VR	,          RR7      p\        P                  ! VR,          VR	,          RR7      p\        WV4       \        P                  ! VR,          VR	,          RR7      p\        P                  ! VR,          VR	,          RR7      p\        WV4       R# )r_   Nr   T	equal_varFr	  r
  r  r  r  r  )r  r  r   r,  r+   r   )r-   r  r  r  r  res4res5s   &      r1   r  TestTtest_ind.test_vs_nonmaskedw  sw   ((**73lB wt}gdm<wt}=# wt}gdm$Gwt}4H#wu~wu~AFQG# ?# wt}gdmtLwt}M#wt}gdmuMwt}N#r4   c                n   \         P                  ! V P                  P                  R4      . RO. R	O.R7      p\        P
                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       VR
,          VR,          3\        P                  \        P                  .RR.33 Fm  p\        P                  ! V!  w  r4\        V\        P                  \        P                  34       \        V\        P                  \        P                  34       Ko  	  RRR4       R#   + '       g   i     R# ; ir  )ri   r   r  r  r   r   rt  r   r)   r   r+   r,  r   r  s   &    r1   r  TestTtest_ind.test_fully_masked  r  r  c                    V P                   P                  R4      . RO,           p\        P                  ! VR,          VR,          4      pRp\	        W#RR7       R# r  )r  r  r+   r,  r   r   s   &   r1   r  $TestTtest_ind.test_result_attributes  r"  r4   c                    \         P                  ! . . 4      p\        \        P                  ! \        P
                  ! V4      4      4       R # r  )r+   r,  r   r)   rr  rs  r'  s   & r1   r(  TestTtest_ind.test_empty  r*  r4   c                \   \         P                  ! . RO. RO4      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        P                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       \         P                  ! . RO. RO4      w  r\        V\        P                  \        P                  34       \        V\        P                  \        P                  34       RRR4       \         P                  ! . RO. RORR7      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        \         P                  ! . RO. RORR7      \        P                  \        P                  34       R#   + '       g   i     L; i)r'   ru   r  NFrG  rp  r  )r+   r,  r   r)   r-  r  r   r   rt  r   r   r   r.  s   &  r1   r/   TestTtest_ind.test_zero_division  s   	95bffQi^bffa[1$$&&##A>S##Iy9DAq266266"23q266266"23 ' 	9FbffQi^bffa[16++Iy6;=?Avvrvv>N	P '&s   -BFF+	c                    R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! . RO. RORR7       RRR4       R#   + '       g   i     R# ; ir2  r6  r7  s   & r1   r  "TestTtest_ind.test_bad_alternative  r9  r:  r  r  r  c                $   \         P                  P                  ^
^^d^{R7      p\         P                  P                  ^^^d^{R7      p\         P                  ! W#VR7      w  rE\        P                  ! W#VR7      w  rg\        WdRR7       \        WuRR7       \        P                  VR&   \        P                  VR&   \        P                  P                  V\        P                  ! V4      R7      p\        P                  P                  V\        P                  ! V4      R7      p\         P                  ! VP                  4       VP                  4       VR7      w  rE\        P                  ! W#VR7      w  rg\        WdRR7       \        WuRR7       R# )	r[   r  r  rO   rA   r=  :rd   re   Nr\   N)r   r  r  r,  r+   r   r)   r   ri   r   rs  r>  r>  s   &&      r1   r  TestTtest_ind.test_alternative  s   JJNNr3NGJJNNq#NF__Q{C
+>e,e, &&$66%EEqrxx{3EEqrxx{3__Q\\^Q\\^1<>
+>e,e,r4   rA  Nr6   r7   r8   r9   r  r  r  r  r(  r/  r  r   r   rh  r  r:   r;   r<   s   @r1   rC  rC  s  sU     5$8
86(P F
 [[]VY,?@- A-r4   rC  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
]P                  P                  R	R
R.4      R 4       tRtV tR# )TestTtest_1sampi  c                N    \         P                  P                  R 4      V n        R# )l   GzP Nr  r  s   &r1   r  TestTtest_1samp.setup_method  r  r4   c                    V P                   P                  R4      . RO,           p\        P                  ! VR,          ^4      p\        P                  ! VR,          ^4      p\        W#4       R# )r_   Nr	  r
  r  )r  r  r   ttest_1sampr+   r   )r-   r  r  r  s   &   r1   r  !TestTtest_1samp.test_vs_nonmasked  sQ    ((**73lB   2!!'$-3#r4   c                
   \         P                  ! V P                  P                  ^4      . ROR7      p\        P
                  \        P
                  3p\        P                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       \        P
                  \        P
                  3R3VR33 F/  p\        P                  ! V!  w  rE\        WR4       \        WB4       K1  	  RRR4       R#   + '       g   i     R# ; i)rR   r\   ru   r  r   Nr  )ri   r   r  r  r)   r   r   r   rt  r   r+   r^  r   )r-   r  r%  r  r  r   s   &     r1   r  !TestTtest_1samp.test_fully_masked  s    //$((":":1"=INFFBFF#$$&&##A>S66266*C07C.A))40"1/"1/ B '&&&s   1A6C11D	c                    V P                   P                  R4      . RO,           p\        P                  ! VR,          ^4      pRp\	        W#RR7       R# )r_   Tr   Nr	  r
  r  rE  )r  r  r+   r^  r   r   s   &   r1   r  &TestTtest_1samp.test_result_attributes  s@    ((**73lB  2,
C5r4   c                    \         P                  ! . ^4      p\        \        P                  ! \        P
                  ! V4      4      4       R# )rN   N)r+   r^  r   r)   rr  rs  r'  s   & r1   r(  TestTtest_1samp.test_empty  s-    !!"a(rxx~&'r4   c                   \         P                  ! . RO^4      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        P                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       \         P                  ! . RO^ 4      w  r\        \        P                  ! V4      4       \        V\        P                  \        P                  34       RRR4       R#   + '       g   i     R# ; i)r'   ru   r  Nrp  )r+   r^  r   r)   r-  r  r   r   rt  r   r   rs  r   r   r.  s   &  r1   r/  "TestTtest_1samp.test_zero_division  s    !!)Q/bffQi^bffa[1$$&&##A>S%%i3DABHHQK q266266"23 '&&&s   +BC66D	c                    R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! . RO^RR7       RRR4       R#   + '       g   i     R# ; i)r3  r
  r4  r  Nr5  )r   r   r  r+   r^  r7  s   & r1   r  $TestTtest_1samp.test_bad_alternative  s9    E]]:S11y!? 2111s   AA	r  r  r  c                8   \         P                  P                  ^
^^d^{R7      p\         P                  ! V^	VR7      w  r4\        P                  ! V^	VR7      w  rV\        WSRR7       \        WdRR7       \        P                  VR&   \        P                  P                  V\        P                  ! V4      R7      p\         P                  ! VP                  4       ^	VR7      w  r4\        P                  ! V^	VR7      w  rV\        WSRR7       \        WdRR7       R# r<  )r   r  r  r^  r+   r   r)   r   ri   r   rs  r>  )r-   r  rF   r?  r  r  r   s   &&     r1   r   TestTtest_1samp.test_alternative  s    JJNNr3NG&&q!E
!!!QK@e,e, &&$EEqrxx{3&&q||~q3>@
!!!QK@e,e,r4   rA  NrX  r<   s   @r1   rZ  rZ    sT     5$	06(	4@
 [[]VY,?@- A-r4   rZ  c                   *   a  ] tR tRt o RtR tRtV tR# )TestDescribei  zu
Tests for mstats.describe.

Note that there are also tests for `mstats.describe` in the
class TestCompareWithStats.
c                   \         P                  P                  . RO. R	O.. R
O. RO.R7      p\        P                  ! V^R7      p\        VP                  ^^.4       VP                  w  r4\        V^ ^.4       \        V^^.4       \        VP                  RR.4       \        VP                  RR.4       \        VP                  RR.4       \        VP                  RR.4       R# )r'   r\   r   r   r!   r   r   N)r'   rN   rQ   rR   rS   r   )r   r   r'   r   rR   rR   )r'   r'   r'   r'   r'   rN   )r'   r'   rN   rN   r'   r'   g       )r)   ri   r   r+   describer   nobsminmaxmeanvarianceskewnessr   r  )r-   rW   r(  aminamaxs   &    r1   test_basic_with_axis!TestDescribe.test_basic_with_axis!  s    EE 2 2 4%7%7%9  : +V[[1a&)]]
TAq6"TAq6"V[[3*-V__sCj1V__sCj1$6r4   r5   N)r6   r7   r8   r9   r,  rx  r:   r;   r<   s   @r1   rm  rm    s     7 7r4   rm  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R tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R% t'R& t(R' t)R(t*V t+R)# )*TestCompareWithStatsi2  a  
Class to compare mstats results with stats results.

It is in general assumed that scipy.stats is at a more mature stage than
stats.mstats.  If a routine in mstats results in similar results like in
scipy.stats, this is considered also as a proper validation of scipy.mstats
routine.

Different sample sizes are used for testing, as some problems between stats
and mstats are dependent on sample size.

Author: Alexander Loew

NOTE that some tests fail. This might be caused by
a) actual differences or bugs between stats and mstats
b) numerical inaccuracies
c) different definitions of routine interfaces

These failures need to be checked. Current workaround is to have disabled these
tests, but issuing reports on scipy-dev

c                
    . RO# )z8Returns list of sample sizes to be used for comparison. )r  rf   r[   r   r5   r  s   &r1   get_nTestCompareWithStats.get_nJ  s    !!r4   c                   \         P                  P                  R 4      pVP                  V4      pW2P                  V4      ,           p\         P                  ! \        V4      ^,           R4      p\         P                  ! \        V4      ^,           R4      pW5^ \        V4      % WF^ \        V4      % VR8  p\         P                  P                  WWR7      p\         P                  P                  WgR7      pW4WV3# )i g 7yACg s?Cr\   )r)   r  RandomStaterandnr  r  ri   r*   )r-   r  r  rF   r   r  ymr]   s   &&      r1   generate_xy_sample'TestCompareWithStats.generate_xy_sampleN  s     ii##G,IIaL		!WWSVaZ&WWSVaZ&1SV1SVDyUU[[['UU[[['R|r4   c                   \         P                  ! W3\         P                  4      p\         P                  ! W3\         P                  4      p\         P                  ! V^,           V3\         P                  4      p\         P                  ! V^,           V3\         P                  4      p\        V4       F"  pV P	                  V4      w  VRV3&   VRV3&   rK$  	  V^ V V^ V1R3&   V^ V V^ V1R3&   \         P
                  P                  V\         P                  ! V4      R7      p\         P
                  P                  V\         P                  ! V4      R7      pW4WV3# )r   r  r\   )r)   r  r   r   r  ri   r*   rs  )
r-   r  nxrF   r   r  r  r  r  r  s
   &&&       r1   generate_xy_sample2D)TestCompareWithStats.generate_xy_sample2D]  s   GGQGRVV$GGQGRVV$WWac2Y'WWac2Y'rA'+'>'>q'A$AadGQq!tWb"  qV1Q36
qV1Q36
UU[["((2,[/UU[["((2,[/R|r4   c                .   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! W#4      p\        P                  P                  WE4      p\        \        P                  ! V4      \        P                  ! V4      4       K  	  R # r  )r}  r  r   rV  r+   r   r)   r   )r-   r  rF   r   r  r  result1result2s   &       r1   test_linregress$TestCompareWithStats.test_linregressl  sf    A2215LA"&&q,Gll--b5GBJJw/G1DE	 r4   c                   V P                  4        Fj  pV P                  V4      w  r#rE\        P                  ! W#4      w  rg\        P                  P                  WE4      w  r\        Wh^R7       \        Wy^R7       Kl  	  R# )   r   N)r}  r  r   r   r+   r	   
r-   r  rF   r   r  r  r   r   rmpms
   &         r1   r   "TestCompareWithStats.test_pearsonrs  s`    A2215LA">>!'DA\\**22FBr2r2 r4   c                    V P                  4        Fh  pV P                  V4      w  r#rE\        P                  ! W#4      w  rg\        P                  P                  WE4      w  r\        Wh^4       \        Wy^4       Kj  	  R# r  N)r}  r  r   r   r+   r	   r  s
   &         r1   r  #TestCompareWithStats.test_spearmanr|  s`    A2215LA"??1(DA\\++B3FBr*r* r4   c                r    \         P                  ! ^4      p\        \        \        P
                  WR4       R# )r   FN)r)   r   r$  r  r+   r   r   s   & r1   !test_spearmanr_backcompat_useties6TestCompareWithStats.test_spearmanr_backcompat_useties  s%     IIaLj&"2"2A%@r4   c                   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! \	        V4      4      p\        P
                  P                  \	        V4      4      p\        WgR R7       \        P                  ! \	        V4      4      p\        P
                  P                  \	        V4      4      p\        WgR R7       K  	  R# )gvIh%<=rA   N)r}  r  r   rC   r-  r+   r   r-   r  rF   r   r  r  r   r  s   &       r1   
test_gmeanTestCompareWithStats.test_gmean  s    A2215LA"CF#A##CG,BA.CF#A##CG,BA. r4   c                   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! \	        V4      4      p\        P
                  P                  \	        V4      4      p\        Wg^
4       \        P                  ! \	        V4      4      p\        P
                  P                  \	        V4      4      p\        Wg^
4       K  	  R# r[   N)r}  r  r   rI   r-  r+   r	   r  s   &       r1   
test_hmeanTestCompareWithStats.test_hmean  s    A2215LA"CF#A##CG,Br*CF#A##CG,Br* r4   c                `   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        Wg^
4       \        P                  ! V4      p\        P                  P                  V4      p\        Wg^
4       K  	  R# r  )r}  r  r   r  r+   r	   r  s   &       r1   	test_skewTestCompareWithStats.test_skew  s|    A2215LA"

1A""2&Br*

1A""2&Br* r4   c                `   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        Wg^
4       \        P                  ! V4      p\        P                  P                  V4      p\        Wg^
4       K  	  R# r  )r}  r  r   r  r+   r	   r  s   &       r1   r   TestCompareWithStats.test_moment  s|    A2215LA"QA$$R(Br*QA$$R(Br* r4   c                   V P                  4        EFH  pV P                  V4      w  r#rEW"P                  4       ,
          VP                  4       ,          pW3P                  4       ,
          VP                  4       ,          p\	        \
        P                  ! V4      VR R7       \	        \
        P                  ! V4      VR R7       \	        \
        P                  ! V4      \
        P                  P                  V^ \        V4       4      R R7       \	        \
        P                  ! V4      \
        P                  P                  V^ \        V4       4      R R7       EKK  	  R# )绽|=rA   N)	r}  r  rs  r  r   r   r)  r+   r  )r-   r  rF   r   r  r  zxzys   &       r1   r*   TestCompareWithStats.test_zscore  s    A2215LA" ffh,!%%')Bffh,!%%')B ELLORe<ELLORe< ELLOU\\-@-@Ac!f-N!&(ELLOU\\-@-@Ac!f-N!&( ( r4   c                `   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        Wg^
4       \        P                  ! V4      p\        P                  P                  V4      p\        Wg^
4       K  	  R# r  )r}  r  r   r  r+   r	   r  s   &       r1   r  "TestCompareWithStats.test_kurtosis  s~    A2215LA"q!A&&r*Br*q!A&&r*Br* r4   c           
        \         P                  ! ^4      P                  ^^4      p\         P                  P	                  V4      p\
        P                  ! V^R7      p\
        P                  P                  V^R7      p\        VRRR7       \        VRRR7       V P                  4        EF,  pV P                  V4      w  rgr\        \
        P                  P                  VR^ R7      \
        P                  ! VR^ R7      ^R7       \        \
        P                  P                  V	R^ R7      \
        P                  ! VR^ R7      ^R7       \        \
        P                  P                  VR^R7      \
        P                  ! VR^R7      ^R7       \        \
        P                  P                  V	R^R7      \
        P                  ! VR^R7      ^R7       EK/  	  R# )r_   r  g'e@gh㈵>r  N)r   r  r   )r)   r   rt  ri   r*   r   r  r+   r   r}  r  r	   )
r-   rW   amr   r  r  rF   r   r  r  s
   &         r1   r  TestCompareWithStats.test_sem  sd   IIbM!!!Q'UU[[^IIaa \\bq):D1JT2A2215LA" 0 0$Q 0 G %		!$Q ?M 0 0$Q 0 G %		!$Q ?M 0 0$Q 0 G %		!$Q ?M 0 0$Q 0 G %		!$Q ?M M r4   c           	     v   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! V^R7      p\        P                  P                  V^R7      p\        ^4       FE  p\        \        P                  ! Wh,          4      \        P                  ! Wx,          4      ^R7       KG  	  K  	  R# )rN   r  r   N)	r}  r  r   rp  r+   r   r	   r)   r   )	r-   r  rF   r   r  r  r   r  iis	   &        r1   test_describe"TestCompareWithStats.test_describe  s    A2215LA"qq)A&&r&2BAh#BJJqu$5$&JJrv$6,.0 	 r4   c                x    \         P                  ! \        P                  ! ^4      4      pRp\	        WRR7       R# )r   Tr   N)rq  rr  rs  rt  ru  r  )r+   rp  r)   r   r   )r-   r  r  s   &  r1   test_describe_result_attributes4TestCompareWithStats.test_describe_result_attributes  s)    1."
F48r4   c                    V P                  4        FW  pV P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        Wg4       KY  	  R # r  )r}  r  r   r   r+   r   r  s   &       r1   test_rankdata"TestCompareWithStats.test_rankdata  sP    A2215LA"q!A&&q)BA"	 r4   c                T   V P                  4        F  pV P                  V4      w  r#rE\        \        P                  ! V4      \        P
                  P	                  V4      ^4       \        \        P                  ! V4      \        P
                  P	                  V4      ^4       K  	  R# r  )r}  r  r	   r   tmeanr+   r-   r  rF   r   r  r  s   &     r1   
test_tmeanTestCompareWithStats.test_tmean  sl    A2215LA"Au||/A/A"/ErJAu||/A/A"/ErJ r4   c           	     h   V P                  4        EF  pV P                  V4      w  r#rE\        \        P                  ! VR 4      \        P
                  P	                  VR 4      ^
4       \        \        P                  ! VR 4      \        P
                  P	                  VR 4      ^
4       \        \        P                  ! VRR7      \        P
                  P	                  VRR7      ^
4       \        \        P                  ! VRR7      \        P
                  P	                  VRR7      ^
4       EK  	  R# )r   r   )
upperlimitN)r}  r  r	   r   tmaxr+   r  s   &     r1   	test_tmaxTestCompareWithStats.test_tmax  s    A2215LA"

1R 0 % 1 1"R 8">

1R 0 % 1 1"R 8">  

1 < % 1 1" 1 DbJ

1 < % 1 1" 1 DbJ r4   c           	     \   V P                  4        EF  pV P                  V4      w  r#rE\        \        P                  ! V4      \        P
                  P	                  V4      4       \        \        P                  ! V4      \        P
                  P	                  V4      4       \        \        P                  ! VRR7      \        P
                  P	                  VRR7      ^
4       \        \        P                  ! VRR7      \        P
                  P	                  VRR7      ^
4       EK  	  R# )r   )
lowerlimitNr   )r}  r  r   r   tminr+   r	   r  s   &     r1   	test_tminTestCompareWithStats.test_tmin  s    A2215LA"A(9(9"(=>A(9(9"(=>

1 = % 1 1" 1 ErK

1 = % 1 1" 1 ErK r4   c           	         V P                  4        Fe  pV P                  V4      w  r#rE\        P                  ! W#4      p\        P                  P                  WE4      p\        Wg^ \        V4       RR7       Kg  	  R# )r'   r  r  N)r}  r  r   r$  r+   r   r  )r-   r  rF   r   r  r  r'  zms   &       r1   r&  TestCompareWithStats.test_zmap   s\    A2215LA"

1 A""2*BA!CF|%8	 r4   c                X   V P                  4        F  pV P                  V4      w  r#rE\        \        P                  ! V4      \        P
                  P	                  V4      ^R7       \        \        P                  ! V4      \        P
                  P	                  V4      ^R7       K  	  R# rc  r   N)r}  r  r	   r   r  r+   r  s   &     r1   r  #TestCompareWithStats.test_variation'  st    A2215LA" 2ELL4J4J24N(*, 2ELL4J4J24N(*,	 r4   c                X   V P                  4        F  pV P                  V4      w  r#rE\        \        P                  ! V4      \        P
                  P	                  V4      ^R7       \        \        P                  ! V4      \        P
                  P	                  V4      ^R7       K  	  R# r  )r}  r  r	   r   tvarr+   r  s   &     r1   	test_tvarTestCompareWithStats.test_tvar/  sr    A2215LA"

1u||/@/@/D(*,

1u||/@/@/D(*,	 r4   c                   \         P                  ! ^4      p\        P                  ! VR4      p\        P                  P                  VR4      p\        \         P                  ! V4      VP                  VP                  ( ,          4       R# )r_   r	  N)	r)   r   r   r|  r+   r   r  r.   r]   )r-   rW   r&  bms   &   r1   test_trimboth"TestCompareWithStats.test_trimboth7  sV    IIbMNN1c"\\""1c*
BGGRWWH$56r4   c           	        V P                  4        F  pV P                  V4      w  r#rE\        \        P                  ! V4      \        P
                  P	                  V4      ^R7       \        \        P                  ! V4      \        P
                  P	                  V4      ^R7       \        \        P                  ! VRR7      \        P
                  P	                  VRR7      ^R7       K  	  R# )r  r   )rn  N)ro  r   )r}  r  r	   r   tsemr+   r  s   &     r1   	test_tsemTestCompareWithStats.test_tsem=  s    A2215LA"

1u||/@/@/D(*,

1u||/@/@/D(*,

1Y ? % 1 1"Y 1 G(*, r4   c                    V P                  4        F`  pV^8  g   K  V P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        Wg4       Kb  	  R# )r   N)r}  r  r   r  r+   r   r  s   &       r1   test_skewtest"TestCompareWithStats.test_skewtestH  sW    A1u#66q9bNN1%\\**2.& r4   c                    \         P                  ! R4      ^,          p\        P                  ! V4      pRp\	        W#RR7       R# r  )r)   r*   r+   r  r   r  s   &   r1   test_skewtest_result_attributes4TestCompareWithStats.test_skewtest_result_attributesQ  s3    HH+,a/ooa ,
C5r4   c                F   \         P                  P                  R 4      pVP                  R4      R,          p\        P                  ! V4      p\        P
                  P	                  V4      p\        \         P                  ! V4      \         P                  ! V4      4       R# )l   ]L g      4@N)r_   rQ   )r)   r  r  r   r  r+   r   r   )r-   r  rF   r   r  s   &    r1   test_skewtest_2D_notmasked/TestCompareWithStats.test_skewtest_2D_notmaskedW  se    ii##J/JJw#%NN1\\""1%

1rzz"~6r4   c                   ^pV P                  4        F  pV^8  g   K  V P                  W!4      w  r4rV\        P                  ! V4      p\        P                  P                  V4      p\        V^ ,          ^ ,          V^ ,          ^ ,          RR7       \        V^ ,          ^,          V^ ,          ^,          RR7       K  	  R# )rQ   rO   rA   N)r}  r  r   r  r+   r   )	r-   r  r  rF   r   r  r  r   r  s	   &        r1   test_skewtest_2D_WithMask.TestCompareWithStats.test_skewtest_2D_WithMask_  s    A1u#88?bNN1%\\**2.!QAq>!QAq> r4   c                   \         P                  ! R R7      ;_uu_ 4        \        P                  ! 4       ;_uu_ 4        \        P                  ! RR\
        4       \        P                  ! RR\
        4       V P                  4        F  pV^8  g   K  V P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        \         P                  ! V4      \         P                  ! V4      4       K  	  RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r  )overru   z(`kurtosistest` p-value may be inaccuratez!kurtosistest only valid for n>=20N)r)   rx   r   r   rt  UserWarningr}  r  r   r  r+   r   r   r  s   &       r1   test_normaltest$TestCompareWithStats.test_normaltestj  s    [[g&&(?(?(A(A##DkS##={LZZ\q5#'#:#:1#=LA"((+A004B#BJJqM2::b>B " )B&&(A(A&&&s*   D9AD&	BD&	D9&D61D99E
	c                   \         P                  ! . RO4      P                  R4      p\         P                  ! . R	O4      P                  R4      pVR8H  p\         P                  P	                  W#R7      pVP                  4       VP                  4       re\         P                  ! VRR7      w  rxWx^8  ,          W^8  ,          3p	\        P                  P                  V4      p
\        W4       \        W4       \        WF4       \        P                  P                  . 4      w  r\        V\         P                  ! ^ \         P                  R7      4       R# )
rN   r,  rB  r\   T)return_countsr   N)rN   rN   rQ   rQ   rR   rR   rR   rS   rS   rS   rS   )rN   rN   rQ   rQ   rR   rR   rR   rS   rS   rS   rS   r   r   r   r   )r)   r   r   ri   r*   r   uniquer   r+   find_repeatsr   intp)r-   rF   tmpr]   r  x_origxm_origr  unique_countsr   r  r  r  s   &            r1   test_find_repeats&TestCompareWithStats.test_find_repeatsw  s    JJ89@@IjjFGNNwWr	UU[[[(&&(BGGI "		!4 @1$%}Q5F'GG\\&&r*QQR! LL--b1	VRXXarww78r4   c                6   V P                  4        F  pV P                  V4      w  r#rE\        P                  ! W#4      p\        P                  P                  WE4      p\        V^ ,          V^ ,          ^
R7       \        V^,          V^,          ^R7       K  	  R# )r'   r   N)r}  r  r   r#  r+   r	   r  s   &       r1   r)  $TestCompareWithStats.test_kendalltau  sr    A2215LA"  &A((0B!beR8!beQ7 r4   c           	     
   V P                  4        Fn  pV P                  V4      w  r#rE\        P                  ! V4      p\        P                  P                  V4      p\        VP                  V^ \        V4       4       Kp  	  R# )r'   N)r}  r  r   r0  r+   r	   r5  r  r  s   &       r1   r2  )TestCompareWithStats.test_obrientransform  sb    A2215LA"%%a(A--b1BR#a&\2	 r4   c                
   R EFf  p\         P                  ! 4       ;_uu_ 4        R EF5  pV P                  4        EF  pV P                  V4      w  rErg\        P
                  ! V\        P                  P                  W!R7      p\        P                  P                  V\        P                  P                  W!R7      p	\        \        P                  ! V4      \        P                  ! V	4      4       \        P
                  ! V\        P                  P                  W!R7      p
\        \        P                  ! V4      \        P                  ! V
4      4       EK  	  EK8  	  RRR4       EKi  	  R#   + '       g   i     EK  ; i)zFChecks that mstats.ks_1samp and stats.ks_1samp agree on masked arrays.r  r  Nautorb  asympr  r  rd  )r   r   r}  r  r   ks_1sampr  cdfr+   r   r)   r   r-   r  r  r  rF   r   r  r  r  r  r  s   &          r1   test_ks_1samp"TestCompareWithStats.test_ks_1samp  s    .D((**#CK!ZZ\'+'>'>q'Ab$~~a:E R$||44RAL  5  Y$RZZ%5rzz$7GH$~~b%**..:E R$RZZ%5rzz$7GH * $D +* /***s   D=E00Fc                r   R EF  p\         P                  ! 4       ;_uu_ 4        R F  pV P                  4        F  pV P                  V4      w  rErg\        P
                  ! VRW!R7      p\        P                  P                  VRW!R7      p	\        \        P                  ! V4      \        P                  ! V	4      4       \        P
                  ! VRW!R7      p
\        \        P                  ! V4      \        P                  ! V
4      4       K  	  K  	  RRR4       EK  	  R#   + '       g   i     EK3  ; i)zM
Checks that 1-sample mstats.kstest and stats.kstest agree on masked arrays.
r  r  Nr  r  )
r   r   r}  r  r   kstestr+   r   r)   r   r  s   &          r1   test_kstest_1samp&TestCompareWithStats.test_kstest_1samp  s     /D((**#CK!ZZ\'+'>'>q'Ab$||Av8C P$||222v?J  3  W$RZZ%5rzz$7GH$||B8C P$RZZ%5rzz$7GH * $D +* /***s   C1D$$D6c                   R EF<  p\         P                  ! 4       ;_uu_ 4        VR9   d   Rp\         P                  ! RV\        4       R F  pV P	                  4        F  pV P                  V4      w  rVrx\        P                  ! WVW1R7      p	\        P                  P                  WxW1R7      p
\        \        P                  ! V	4      \        P                  ! V
4      4       \        P                  ! WvW1R7      p\        \        P                  ! V	4      \        P                  ! V4      4       K  	  K  	  RRR4       EK?  	  R#   + '       g   i     EKU  ; i)zNChecks that mstats.ks_2samp and stats.ks_2samp agree on masked arrays.
gh-8431)ks_2samp: Exact calculation unsuccessful.ru   r  Nr  r  rb  r  )r   r   rt  r   r}  r  r   r8  r+   r   r)   r   r-   r  messager  r  rF   r   r  r  r  r  r  s   &           r1   r=  "TestCompareWithStats.test_ks_2samp  s     /D((**,,IG++Hg~N#CK!ZZ\'+'>'>q'Ab$~~a:E R$||44RAL  5  Y$RZZ%5rzz$7GH$~~b:E R$RZZ%5rzz$7GH * $D	 +* /***   DEEc                   R EF<  p\         P                  ! 4       ;_uu_ 4        VR9   d   Rp\         P                  ! RV\        4       R F  pV P	                  4        F  pV P                  V4      w  rVrx\        P                  ! WVW1R7      p	\        P                  P                  WxW1R7      p
\        \        P                  ! V	4      \        P                  ! V
4      4       \        P                  ! WvW1R7      p\        \        P                  ! V	4      \        P                  ! V4      4       K  	  K  	  RRR4       EK?  	  R#   + '       g   i     EKU  ; i)zM
Checks that 2-sample mstats.kstest and stats.kstest agree on masked arrays.
r  ru   r  Nr  r  r  )r   r   rt  r   r}  r  r   r  r+   r   r)   r   r  s   &           r1   test_kstest_2samp&TestCompareWithStats.test_kstest_2samp  s     /D((**,,IG++Hg~N#CK!ZZ\'+'>'>q'Ab$||A8C P$||222?J  3  W$RZZ%5rzz$7GH$||B8C P$RZZ%5rzz$7GH * $D	 +* /***r  r5   N),r6   r7   r8   r9   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  r  r  r)  r2  r  r	  r=  r  r:   r;   r<   s   @r1   r{  r{  2  s     ,"F3+A	/
+
+
+($	+M*09#KJ	K9,,7	,'67	?C9(83I I$I(I Ir4   r{  c                   .  a  ] tR tRt o ]P
                  P                  ^^^^^]P                  ^^^^^^^^^]P                  .4      t]P
                  P                  ^^^^]P                  ^^^^^^^.4      t	^t
R tR tR tR tR tR tR tR	tV tR
# )TestBrunnerMunzeli  c                   \         P                  ! V P                  V P                  R R7      w  r\         P                  ! V P                  V P                  RR7      w  r4\         P                  ! V P                  V P                  RR7      w  rV\         P                  ! V P                  V P                  R R7      w  rx\	        W$V P
                  R7       \	        WhV P
                  R7       \        W&8g  4       \	        VRV P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       R# )	r  r  r  r   |	&	@gҏGg?g@-pL?N|	&	)r+   brunnermunzelXYr	   significantr   )	r-   u1r  u2r  u3r  u4p4s	   &        r1   test_brunnermunzel_one_sided.TestBrunnerMunzel.test_brunnermunzel_one_sided  s(   %%dffdff&I%%dffdff)L%%dffdff)L%%dffdff&IBD,<,<=BD,<,<=B 2$($4$4	6B 3$($4$4	6B 2$($4$4	6B 3$($4$4	6B 5$($4$4	6B 3$($4$4	6r4   c                   \         P                  ! V P                  V P                  R R7      w  r\         P                  ! V P                  V P                  R R7      w  r4\	        W$V P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       R# )rd  r  r   r   ҏGw?Nr  r+   r  r  r  r	   r  r-   r  r  r  r  s   &    r1   test_brunnermunzel_two_sided.TestBrunnerMunzel.test_brunnermunzel_two_sided  s    %%dffdff+N%%dffdff+NBD,<,<=B 2$($4$4	6B 3$($4$4	6B 5$($4$4	6r4   c                x   \         P                  ! V P                  V P                  4      w  r\         P                  ! V P                  V P                  4      w  r4\	        W$V P
                  R 7       \	        VRV P
                  R 7       \	        VRV P
                  R 7       \	        VRV P
                  R 7       R# )r   r  r&  Nr  r'  r(  s   &    r1   test_brunnermunzel_default,TestBrunnerMunzel.test_brunnermunzel_default  s    %%dffdff5%%dffdff5BD,<,<=B 2$($4$4	6B 3$($4$4	6B 5$($4$4	6r4   c                    R pRp\        VR9  4       \        \        \        P                  V P
                  V P                  VV4       R# )r   r  Nrc  r   r$  r  r+   r  r  r  r-   r  distributions   &  r1   $test_brunnermunzel_alternative_error6TestBrunnerMunzel.test_brunnermunzel_alternative_error  sA    #CCDj**ffff!"	$r4   c                   \         P                  ! V P                  V P                  R R7      w  r\         P                  ! V P                  V P                  R R7      w  r4\	        W$V P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       \	        VRV P
                  R7       R# )normal)r1  r   r  g "H[?Nr  r'  r(  s   &    r1   $test_brunnermunzel_distribution_norm6TestBrunnerMunzel.test_brunnermunzel_distribution_norm)  s    %%dffdff8L%%dffdff8LBD,<,<=B 2$($4$4	6B 3$($4$4	6B 5$($4$4	6r4   c                    R pRp\        VR9  4       \        \        \        P                  V P
                  V P                  VV4       R# )rd  r   N)r  r5  r/  r0  s   &  r1   %test_brunnermunzel_distribution_error7TestBrunnerMunzel.test_brunnermunzel_distribution_error4  s@    !?23j**ffff!"	$r4   c                8   \         P                  ! V P                  . 4      w  r\         P                  ! . V P                  4      w  r4\         P                  ! . . 4      w  rV\	        \
        P                  ! V4      4       \	        \
        P                  ! V4      4       \	        \
        P                  ! V4      4       \	        \
        P                  ! V4      4       \	        \
        P                  ! V4      4       \	        \
        P                  ! V4      4       R # r  )r+   r  r  r  r   r)   rs  )r-   r  r  r  r  r   r  s   &      r1   test_brunnermunzel_empty_imput0TestBrunnerMunzel.test_brunnermunzel_empty_imput?  s    %%dffb1%%b$&&1%%b"-r4   r5   N)r6   r7   r8   r9   r)   ri   masked_invalidr   r  r  r  r#  r)  r,  r2  r6  r9  r<  r:   r;   r<   s   @r1   r  r    s     
aAq!RVVQAq!Q266; 	<A
aAq"&&!Q1aAFGAK6.66	$	6	$
 
r4   r  )NNgHz>)Ar,  r   re  numpyr)   r   numpy.mari   r   r   scipy.stats.mstatsr   r+   scipycommon_testsr   r   r   r$  numpy.ma.testutilsr   r	   r
   r   r   r   r   scipy.statsr   r   scipy.conftestr   scipy.stats._axis_nan_policyr   r   r   rG   rJ   rL   r   r   r   rk  r  r  r  r  r.  r[  r^  r`  r  r  r  r  r  r  r  r  r  rC  rZ  rm  r{  r  r5   r4   r1   <module>rH     s        # # #  -  *E E E 1 . R- -*!! 93 93 93x !3 !3 !3H9 9,z6 z6z	 u: u: u:p V/ V/ V/r& &RA A* 4 4 4@ SJ SJ SJlF, K1 K1\8:.8*E _8 _8 _8D6 6.2 .2b6 6[- [-|_- _-DB- B-J7 70 pI pI pIfc cr4   