+
    ,iU                    $   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 ^ 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       t0]! ! R" R#4      4       t1R$ t2R% t3 ! R& R'4      t4R( t5R) t6R* t7R+ t8]! ! R, R-4      4       t9 ! R. R/4      t: ! R0 R14      t; ! R2 R34      t< ! R4 R54      t= ! R6 R74      t> ! R8 R94      t? ! R: R;4      t@]! ! R< R=4      4       tA ! R> R?4      tBR# )Az?
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)suppress_warnings)_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   &   E/usr/lib/python3/dist-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__r3   __static_attributes____classdictcell____classdict__s   @r2   r   r      s     - -r5   r   c                 |    \         P                  ! WVR 7      p\        WQVR7       \        VP                  V4       R# )r   dtypertolN)r,   gmeanr   r   rA   
array_liker0   r   rA   rC   xs   &&&&& r2   check_equal_gmeanrH   /   s*    Z%8AAT*% r5   c                 |    \         P                  ! WVR 7      p\        WQVR7       \        VP                  V4       R# r@   )r   hmeanr   r   rA   rE   s   &&&&& r2   check_equal_hmeanrK   6   s*    J7AAT*% r5   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# )   +=rB   NrO                  ?)r*   powerrH   r.   ar0   s   &  r2   test_1dTestGeoMean.test_1d>   s!    ((7E*!51r5   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@maskrP   rB   N
r\         (   r)   <   F   P   Z   d   rQ   r(   r(   r(   rO   UUUUUU?)mar+   rH   r*   rV   rW   s   &  r2   
test_1d_maTestGeoMean.test_1d_maC   sH    HH>?!%HH\5((5%(!51r5   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(   rO   r*   rj   r+   rH   rW   s   &  r2   test_1d_ma_valueTestGeoMean.test_1d_ma_valueM   s,    EEKKA;  =!%r5   c                b    \         P                  P                  . RO4      p^ p\        W4       R# )r\   N)
r\   r`   ra   rb   r)   rc   rd   re   rf   r(   ro   rW   s   &  r2   test_1d_ma0TestGeoMean.test_1d_ma0T   s"    EEKK?@!%r5   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`   ra   rb   r)   rc   rd   re   rf   )r*   rj   r+   r   errstaterH   rW   s   &  r2   test_1d_ma_infTestGeoMean.test_1d_ma_infZ   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# )rO   r]   rP   )rA   rC   NrQ   rh   ri   )rj   r+   r*   rV   astyper|   rH   r.   rX   
desired_dts   &  r2   test_1d_float96TestGeoMean.test_1d_float96a   sC     HH\5XXeU+222::>
!rzzFr5   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# )rO   r]   rP   r   rC   g/,$qJ@NrQ   r(   r(   r(   r(   rO   r(   r(   rO   r(   rO   rO   r(   rU         ?rx   r\   r`   ra   rb   r)   rc   rd   re   rf   rg   n   x   )rj   r+   r*   rH   rV   rW   s   &  r2   
test_2d_maTestGeoMean.test_2d_mah   s    HHlL,?'|DF((<(!159((BHHWe4HHS%0HHS%02 3 	!2E: /1DE"%%++a.'2r5   r6   N)r7   r8   r9   r:   rY   rk   rp   rs   rz   pytestmarkskipifhasattrr*   r   r   r;   r<   r=   s   @r2   rM   rM   <   sc     2
2&&* [[GB	22@  BGBG
3 3r5   rM   c                      a  ] tR t^yt 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# )rO   r]   rP   rB   g=b#A@gO?@NrQ   rh   /袋.?r_   rn   rj   r+   rK   r*   rW   s   &  r2   rY   TestHarMean.test_1d{   sk    HH\5+!51EEKKAB!%EEKKA;  =!%r5   r|   r}   r~   c                    \         P                  ! . RO. ROR7      p\        P                  ! R\        P                  R7      p\        W\        P                  R7       R# )rO   r]   rA   NrQ   rh   r   )rj   r+   r*   asarrayr|   rK   r   s   &  r2   r   TestHarMean.test_1d_float96   s7     HH\5ZZ 9L
!rzz:r5   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# )rO   r]   rP   r   gmWUC@NrQ   r   r   r   )gQ?g433333@g?rx   r   r   r   r   rW   s   &  r2   test_2dTestHarMean.test_2d   sx    HHlL,?'|DF((<(!159L!2E:/1DE"%%++a.'2r5   r6   N)r7   r8   r9   r:   rY   r   r   r   r   r*   r   r   r;   r<   r=   s   @r2   r   r   y   sM     & [[GB	22@  B;B;
3 3r5   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(   rO   rO   rO   rR   rS   rT      r      )
rO   rS   rS   rS   r   r            !@r   r\   )
rO   r'   r'   r(   r(   rT   r         @r      )
rO   r'   r'         @r   rT   r   r   r   r   )
r(   rO   r   rO   rR   rT   rS   r   rO   r   )
rO   rS   r   rS   r   r   r   r   rS   r\   )r(   rO   rO   rO   rR   )rS   rT   r   r   r   )rO   rS   rS   rS   r   )r   r   r   r   r\   )rO   rR         @r   r   rO   rO   rO   rO   rO   rR   rR   rR   rR   rR   )rj   r+   r	   r,   rankdatar   r.   rG   s   & r2   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	9r5   r6   N)r7   r8   r9   r:   r   r;   r<   r=   s   @r2   r   r      s     9 9r5   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]   rx         )r           r   )r(   r(   rS   ri   )FFFT)r   r   r   g     X@)r(   r(   rS   rx   )rj   arangewarningscatch_warningssimplefilterRuntimeWarningr	   r,   pearsonrr+   r   r   r*   sqrt)
r.   rG   prx1y1rpr^   x2y2s
   &         r2   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# )	rO   r]   NrO   rR   rS   rT   r   r   )r(   rO   r(   r(   r(   r(   )	   r   r   r   r   r   )r(   r(   rO   r(   r(   r(   )rO   rT   r   r   )r   r   r   r   )r*   rj   masked_arrayr+   r,   r   r   r   )	r.   mxmyrG   ymrmpr   r   s	   &        r2   test_pearsonr_misaligned_mask&TestCorr.test_pearsonr_misaligned_mask   s    UU 29KLUU 29KLHH\"HH\"(~~a#RRr5   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rj   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   rj   fix_invalidlistranger   r.   rG   r   res
attributess   &    r2   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5r5   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       ^dp\        P                  ! ^ ^V4      pRV,          \        P
                  P                  V4      ,           p\         P                  ! W4      w  rx\         P                  ! WRR7      w  r\        W^,          4       \         P                  ! WRR7      w  r\        V^V^,          ,
          4       Yyu;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}?皙?zalternative must be 'less'...matchz	ekki-ekkiNr   r   )
r,   r   r   r*   linspacerandomrandr   r   
ValueError)r.   rG   r   r_expr   r   nstat1p1stat2p2stat3p3s   &            r2   test_spearmanr_alternative#TestCorr.test_spearmanr_alternative  s^   00 #%!,-)<!,-&9!?+ KK1a EBIINN1%%$$Q*	$$QyA	F#$$Qv>	AQJ'&&&&&&]]:-LMMQ{; NMMMs   F55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   rR   r   r   )rT   r   r      rx   r   g?>g}'}'gQg~ȋgXJĿr   )rj   r+   r*   r	   r   r,   
kendalltaur   assert_raisesr  r   r   r   )r.   rG   r   expectedbzresultr  s   &       r2   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8r5   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   floatrj   masked_greaterconcatenater   isfiniter,   r#  )r.   rG   r   s   &  r2   test_kendalltau_largeTestCorr.test_kendalltau_large  sr     IId%(a&IId%(NNAeHah/0F--a3A678r5   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# )rT   zglobal p-value (indep)gMb?zseasonal p-valueNrT   rS   r   rS   rR   r   rS   rO   rO   rR   rS   r   rS   )g
ףp=
?g(\?皙?g{Gz?)r   rj   r   Tr,   kendalltau_seasonalr	   round)r.   rG   outputs   &  r2   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	3r5   r  r  c                   \         P                  P                  ^ 4       ^2p\         P                  P                  V4      p\         P                  P                  V4      p\         P                  P                  V4      R8  p\        P
                  ! WFR7      p\        P
                  ! WVR7      p\        P                  ! WxWR7      p	VP                  4       p
VP                  4       p\        P                  ! WWR7      p\         P                  WF&   \         P                  WV&   \        P                  ! WEVRVR7      p\        W4       \        W4       R# )r(   r   r]   )r  r  omit)r  
nan_policyr  N)r*   r  seedr  rj   r+   r,   r#  
compressedr   r   r   )r.   r  r  r  rG   r   r^   x_maskedy_masked
res_maskedx_compressedy_compressedres_compressedres_nans   &&&           r2   test_kendalltau_mstats_vs_stats(TestCorr.test_kendalltau_mstats_vs_stats  s     			qIINN1IINN1yy~~a 3&88A)88A)&&vH
  **,**,))vP &&&&""FM 	
30r5   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# )rg   g遣m?g:4W?g,
:H r   gK?g(6?N)rg   iY	  )e   i	  )   r(   )   r(   )rL  rO   )   rO   )   iE&  )   i%  itemsr   _kendall_p_exactr	   r.   expectationsncr%  r  s   &    r2   test_kendall_p_exact_medium$TestCorr.test_kendall_p_exact_medium  sr     $%;#%; "8 # "8 ##%;#%;= )..0LB00A1>C. 1r5   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)rY  i5  )i  i\  )i   idd )i!  ih )i@  i 	 )iA  i 	 rP  rS  s   &    r2   test_kendall_p_exact_large#TestCorr.test_kendall_p_exact_large  si     %&<$&<%'=%'=&(>&(>@ )..0LB00A1>C. 1r5   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!# )$rO   g-@g+@g(@g333333$@gffffff@gffffff@g333333@gffffff@g333333@r   gffffff
@g	@r    gffffff@r'   g333333@gffffff@g @r   g      ?g?r   g?皙?gffffff?r   r   r4  r
  g/"?Tr   Nrx   r   )r*   r   r	   r,   pointbiserialrr   r   s   &    r2   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5r5   r6   N)exactr!  	two-sidedr  r	  )r7   r8   r9   r:   r   r   r  r  r   r   r   platformmachiner)  slowr0  r9  parametrizerG  rV  xslowrZ  r   r_  r;   r<   r=   s   @r2   r   r      s$    &>$6L+<Z [[((*i79  ;T9;T9l [[((*i79  ;[[9 ;9
3 [[X'>?[[],LM1 N @1:/ [[/ / 6	 6r5   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)rm  relative)ro  r   
r(   rO   rR   rS   rT   r   r   r   r   r   )rR   r   )
NNrR   rS   rT   r   r   r   r   NFF)
NNNrS   rT   r   r   r   NN)r
  r4  )
NrO   rR   rS   rT   r   r   r   NNrx   )NNrR   rS   rT   Nr   r   r   NNN)
rj   r   r   r,   trimr   reshape_maskravelr5  )r.   rX   rG   r%  trimxs   &    r2   	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5r5   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        RVn
        \        \        P                  ! V4      P                  4       ^<4       \        \        P                  ! V4      P                  4       ^P4       R# )rg   r   )tail:r)   rd   NN)r\   r\   )rj   r   r   r,   trimbothcounttrimtailr   rt  r   shape)r.   rG   rv  s   &  r2   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V__Q'--/4V__Q'--/4r5   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\   rl  r]   N)g333333?gQ?rq  rp  )
rO   rO   r(   r(   r(   r(   r(   r(   r(   rO   )rj   r   r,   trimrr+   r   r^   )r.   rG   r(  r%  s   &   r2   
test_trimrTestTrimming.test_trimr%  sP    IIbMaO88:!?AV&V[[(--0r5   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  )rj   r+   r	   r,   trimmed_meanr.   r/   s   & r2   test_trimmedmeanTestTrimming.test_trimmedmean-  sb    xx @ AF//S93BF//Y?aHF//Y?aHr5   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rO   rO   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   r(   rO   rO   )
r*   r  default_rngsortrj   r+   r   r,   trimmed_varvarr.   rng	data_origr/   s   &   r2   test_trimmedvarTestTrimming.test_trimmedvar4  k     ii##$78JJBJ'	wwy!xx $B C**9c:DHHJGr5   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  rj   r+   r   r,   trimmed_stdstdr  s   &   r2   test_trimmedstdTestTrimming.test_trimmedstd>  r  r5   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  )rj   r+   r	   r,   trimmed_stder  s   & r2   test_trimmed_stdeTestTrimming.test_trimmed_stdeH  sI    xx @ AF//Y?1MF//S98QGr5   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  rq  )	rj   r+   r	   r,   	winsorizer  r   r   r^   )r.   r/   
winsorizeds   &  r2   test_winsorizationTestTrimming.test_winsorizationN  s    xx @ AF,,T)<@@a@H#Q	(T9];??Q?GQ	 Q%%d+
Z__dii0r5   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]  )	rj   r+   r*   r   r$  r  r,   r  r   r  s   & r2   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	:r5   r6   N)r7   r8   r9   r:   rw  r  r  r  r  r  r  r  r  r;   r<   r=   s   @r2   rj  rj    s<     #6J51IHHH
1: :r5   rj  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]   r~  NrA   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   rA   )r.   actualexpectr~  rA   s   &&&$$r2   _assert_equalTestMoments._assert_equal  sL    F#__V3F6*=LLE||u$$$r5   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# )rO   r         ?     @r   r   r   r   )r~  rA   )momentr   )r~  g      $@NrQ   )r(   r  r(   r  )r   rR   rS   r"   )rO   r(   )r(   )rO   )rR   r(   )r,   r  testcaser	   r   r$  r  r  r*   r   float64r+   float32zerosr   r   rj   r   )r.   r   rG   s   &  r2   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("))4r5   c                `    \         P                  ! V P                  4      p\        VR ^
4       R# )%?N)r,   	variationr  r	   )r.   r   s   & r2   test_variationTestMoments.test_variation  s#    T]]+A.3r5   c                ~    \         P                  ! . RO4      p\        P                  ! V^R7      p\	        VR4       R# )rO   r  g<<'?N)rO   rR   rS   rT   r   )r*   r+   r,   r  r	   )r.   rX   r   s   &  r2   test_variation_ddofTestMoments.test_variation_ddof  s/     HH_%QQ'A12r5   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rR   NNN)r,   skewtestmathworksr	   r  rj   r+   r*   boolr   testcase_2d	enumerater   r.   r   
correct_2dirowcorrect_2d_bias_correcteds   &     r2   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:	<r5   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  rj   r+   r*   r  r
   r  r  r   r   r  s   &     r2   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,-	/r5   r6   rQ   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)r7   r8   r9   r:   r  rj   r   r*   r   r  r+   r  r  r  r  r  r  r  r  r;   r<   r=   s   @r2   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%/ %/r5   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(   rO   rO   rO   rR   rS   rS   rS   rS   rT   r   r   r   )rS   r   r   )rS   rR   )rS   rT   )r(   rS   )rO   rO   )rR   rO   )r(   r(   r(   rO   rO   r   rx   )moder|  )	r*   rs  r+   rj   masked_wherer   r,   r  r   )r.   a1a2a3a4ma1ma2ma3ma4a1_resr  s   &          r2   	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8r5   c                    \         P                  ! R4      pVR;;,          ^,          uu&   VR;;,          ^,          uu&   VP                  4       p\        P                  ! VR4       \        W4       R# )rg   N)rg   rg   )Nr)   Nr  )r  r  )r*   r  copyr,   r  r   )r.   imcps   &  r2   test_mode_modifies_input!TestMode.test_mode_modifies_input!  sM     XXj!
6
a

6
a
WWYBRr5   r6   N)r7   r8   r9   r:   r  r  r;   r<   r=   s   @r2   r  r    s     9: r5   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# )rS   N)rS   rT   r   r\   r   )rS   r   r   rT   rR   rO   )r    rT   r   r\   r  r	  r
  r   r  r  r  r.   s   &r2   setup_methodTestPercentile.setup_method-  s    *,1r5   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   & r2   test_percentileTestPercentile.test_percentile2  sY    IIaL3V--a3R8V--a5s;V--a4d;r5   c                    \         P                  ! . RO. RO. RO. RO. RO.4      p\        \        P                  ! V^24      . RO4       R# )rO   NrO   rO   rO   )rT   rT   rS   )rj   r+   r   r,   r  r   s   & r2   test_2DTestPercentile.test_2D8  s<    HHi	! "
 	V--a4i@r5   r  N)	r7   r8   r9   r:   r  r  r  r;   r<   r=   s   @r2   r  r  ,  s     2
<A Ar5   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   &  r2   test_semTestVariability.test_semH  so    JJt}}%A|,MM!

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

4==q9	;r5   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   &  r2   	test_zmapTestVariability.test_zmapP  sG     KKt}}5!D!"6"#&&5"92	Gr5   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  rj   r   r*   r   r	   )r.   r   r0   s   &  r2   test_zscoreTestVariability.test_zscoreY  sF     MM$--(.."24E"2ORVV"M NG3r5   r6   N)r7   r8   r9   r:   __doc__rj   r   r*   r   r  r  r&  r*  r;   r<   r=   s   @r2   r  r  A  s>      ~~q1Qrvv./H;G4 4r5   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   &  r2   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	'r5   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# )rT   glNr3  )48E?gsA?)g%䃞?g 	?)r7  g46<?)	r   rj   r   r5  r	   r*   r7  r,   ks_2samp)r.   rG   winterspringsummerfalls   &     r2   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,	.r5   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       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   )r,   friedmanchisquarer	   r   rj   r   r   )r.   r1  r(  rG   r  s   &    r2   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8r5   r6   N)	r7   r8   r9   r:   r2  r=  rH  r;   r<   r=   s   @r2   r.  r.  b  s     '.9 9r5   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	   rL  rM  rO  rK  )rG   r   r(  lrr  s        r2   test_regress_simplerV    s    
AsC Abkk!S#&&+AAr3'	((Aq$F 
	#	#BJv"#EJt4V,,, &9:((*<=';<//1DEr5   c                     \         P                  ! ^
4      p \         P                  P                  ^
4      pRp\        \        VR7      ;_uu_ 4        \
        P                  ! W4       RRR4       R#   + '       g   i     R# ; i)r\   zBCannot calculate a linear regression if all x values are identicalr  N)r*   r  r  r$  r  r,   rQ  )rG   r   msgs      r2   test_linregress_identical_xrY    sR    
A
		A
NC	z	-	-! 
.	-	-	-s   A22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(   rO   rO   )r(   rO   rg   rO   )FFTFri   gUUUUUU?)rO   rR   rS   rT   r\         )r         r`   -   7   N   )r,   theilslopesr	   r*   rj   r+   )r.   rL  rM  lowerupperr   rG   s   &      r2   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3r5   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       \        4       ;_uu_ 4       pVP                  \        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)zHAll `x` coordinates.*|Mean of empty slice\.?|invalid value encountered.*r  Nzinvalid value encountered...r(   r(   r(   )r(   rO   r(   )r   warnsr   r,   re  r*   allisnanr   filterr   r   )r.   rX  r  sups   &   r2   test_theilslopes_warnings)TestTheilslopes.test_theilslopes_warnings  s    Y\\.44$$aVaV4C66"((3-(((( 5   CJJ~'EF$$Y	:CC!Q!78 !  54 !  s   AC8AD8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rO   rR   rT   rT   r   r   )r,   re  r   rL  rM  	low_slope
high_slope)r.   r   rG   rL  rM  rv  rw  r(  s   &       r2   'test_theilslopes_namedtuple_consistency7TestTheilslopes.test_theilslopes_namedtuple_consistency  sk    
 282D2DQ2J/)##A) 	ULL)Y 0 01Y 0 01Z!2!23r5   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  rA   N)
r*   r  r  integersuint8r   re  testingr   rL  )r.   r  r   r  s   &   r2   test_gh19678_uint8"TestTheilslopes.test_gh19678_uint8  s[     ii##$45LLCbL9%


""399a0r5   r6   N)
r7   r8   r9   r:   rh  rq  rx  r~  r;   r<   r=   s   @r2   r[  r[    s     $4N	94 1 1r5   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# )rR   r   separater  r      :NrT   Nr   r  random_stater
  rB   N)r   r   )rB  r  gffffff)
r*   r   r   r,   siegelslopesr   normrvsrQ  r   )r   rG   	slope_olsintercept_ols_rL  rM  s          r2   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7r5   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.
Nrt  ru  )r,   r  r   rL  rM  )r   rG   rL  rM  r(  s        r2   (test_siegelslopes_namedtuple_consistencyr    sM    
 	AA**10E  &F %,,-r5   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  rG   dydxr^   s   &     r2   dijk&test_sen_seasonal_slopes.<locals>.dijk0  sn    GIIaLQ

]##1bjj=!!wwrwwvT2a8x  r5   r  N)rg   rT   )
r*   r  r  r,   sen_seasonal_slopesr   r   medianr.  r~  )r  rG   intra_slopeinter_sloper  r  
all_slopess          r2   test_sen_seasonal_slopesr  *  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# )rS   N)rU   r   r   )r,   plotting_positionsr*   r   r
   r/   r+   )poss    r2   test_plotting_positionsr  ?  s6    

#
#BIIaL!Q
7Cchh1B(CDr5   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# )TestNormalitytestsiE  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)rR   r  Nr  rx   r(   rO   rR   rS   r  rx   r(   rO   rR   rS   r  rx   r(   rO   rR   rS   r  rx   r(   rO   rR   rS   rQ   )r*   r+   r
   r,   
normaltestr   skewtestkurtosistestzipr   rl  r   r   rn  rF  r   r$  r  )r.   rG   funcsmfuncsfuncmfuncr  s   &      r2   test_vs_nonmasked$TestNormalitytests.test_vs_nonmaskedH  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# )rR   Nr   r  )r*   r+   r   r,   r  r  r  r   s   & r2   test_axis_None!TestNormalitytests.test_axis_None[  s{    HH&'*))!$79J9J19MN5vq7IJ++AD9++A.	0r5   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# )rR   TFr]   Nr  )r*   r+   rj   r_infr  r   r,   r  r   r  r  )r.   rG   xms   &  r2   test_maskedarray_input)TestNormalitytests.test_maskedarray_inputc  s    HH+,a/UU[[rvvq"}- eeD5'AFF*:D$@A  C))"-u/?/?/BC+U^^A->?++B/1C1CA1FGr5   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# )rR   Nr  )	r*   r+   vstackr5  r,   r  r  r  r   )r.   rG   x_2dr  res_1dres_2ds   &     r2   test_nd_input TestNormalitytests.test_nd_inputl  s    HH+,a/yy!q!##&&9L9LMD!WF$ZFF1Iq	{Q7F1Iq	{Q7	 Nr5   c                    \         P                  ! R4      ^,          p\        P                  ! V4      pRp\	        W#RR7       R# rR   Tr   Nr  rE  )r*   r+   r,   r  r   r.   rG   r  r  s   &   r2   !test_normaltest_result_attributes4TestNormalitytests.test_normaltest_result_attributesu  s5    HH+,a/",
C5r5   c                    \         P                  ! R4      ^,          p\        P                  ! V4      pRp\	        W#RR7       R# r  )r*   r+   r,   r  r   r  s   &   r2   #test_kurtosistest_result_attributes6TestNormalitytests.test_kurtosistest_result_attributes{  s5    HH+,a/!!!$,
C5r5   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  crG   s   &    r2   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:rO   r   Nr]   N)r   r  r  getattrr,   r   r*   r   rj   r   rn  r?  )
r.   r  r  rG   
stats_testmstats_testz_exp_exr'  r   s
   &&&       r2   test_alternative#TestNormalitytests.test_alternative  s     JJNNr2CNHUD)
fd+;
16e,e, #EEqrxx{3KH
16e,e,r5   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.   rG   rX  s   &  r2   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	r6   N)r7   r8   r9   r:   r  r  r  r  r  r  r  r   r   rg  r  r  r;   r<   r=   s   @r2   r  r  E  s}     0&0H866= [[Vj.%AB[[]VY,?@- A C-&8 8r5   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.   rX   r&  r  r  s   &    r2   test_result_attributes"TestFOneway.test_result_attributes  sO    HHc3Zryy1HHc3Zryy1ooa#,
C5r5   r6   Nr7   r8   r9   r:   r  r;   r<   r=   s   @r2   r  r    s     6 6r5   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,   mannwhitneyurG   r   r   )r.   r  r  s   &  r2   r  'TestMannwhitneyu.test_result_attributes  s+    !!$&&$&&1,
C5r5   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  rG   r   r   rF  r   r   )r.   res1res2s   &  r2   test_against_stats#TestMannwhitneyu.test_against_stats  s`     ""4664662!!$&&$&&1~~///T[[1r5   r6   N)r7   r8   r9   r:   r*   r+   rG   r   r  r  r;   r<   r=   s   @r2   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 2r5   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# )rO   Tr   N)rO   rS   r   r   r   )rR   rT   r   r   r\   rE  )r,   kruskalr   r   s   &    r2   r  "TestKruskal.test_result_attributes  s)    nnQ",
C5r5   r6   Nr  r=   s   @r2   r  r    s     6 6r5   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_reli  c                   \         P                  P                  R 4       \         P                  P                  ^^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# ) Nr   r(   r(   rO   rR   r  r(   r  rO   r  :NrR   Nr  :rR   NN)r*   r  r>  randnr   	ttest_relr,   r   )r.   outcomer  r  res3s   &    r2   r  TestTtest_rel.test_vs_nonmasked  s	   
		w))//"a(<7 wt}gdm<wt}=# wt}gdm$Gwt}4H#wu~wu~AFQG# ?#r5   c                   \         P                  P                  R 4       \        P                  ! \         P                  P                  ^^4      . RO. RO.R7      p\        4       ;_uu_ 4       pVP                  \        R4       VR,          VR	,          3\         P                  \         P                  .RR.33 Fm  p\        P                  ! V!  w  rE\        V\         P                  \         P                  34       \        V\         P                  \         P                  34       Ko  	  RRR4       R#   + '       g   i     R# ; i
r  r]   %invalid value encountered in absoluter   r   Nr  rk  r  r  )r*   r  r>  rj   r   r  r   ro  r   r   r,   r  r   r.   r	  rp  pairtr   s   &     r2   test_fully_maskedTestTtest_rel.test_fully_masked  s    
		w//"))//!Q"7(19'=?  CJJ~'NO!$-766266*S#J79''."1rvvrvv&67"1rvvrvv&67	9 !      .B>D66E	c                    \         P                  P                  R 4       \         P                  P                  ^^4      . RO,           p\        P
                  ! VR,          VR,          4      pRp\        W#RR7       R# r  Tr   Nr  r  r  rE  )r*   r  r>  r  r,   r  r   r.   r	  r  r  s   &   r2   r  $TestTtest_rel.test_result_attributes  T    
		w))//"a(<7wt}gdm<,
C5r5   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   rs  r   s   & r2   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r5   c                    \         P                  ! . . 4      p\        \        P                  ! \        P
                  ! V4      4      4       R # r  )r,   r  r   r*   rm  rn  r.   r  s   & r2   
test_emptyTestTtest_rel.test_empty   -    B'rxx~&'r5   c           	     `   \         P                  ! . RO. RO4      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        4       ;_uu_ 4       pVP                  \        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(   r  Nrk  r  )r,   	ttest_indr   r*   absr  r   ro  r   r   r+   r   r.   r  r   rp  s   &   r2   test_zero_division TestTtest_rel.test_zero_division$  s    	95bffQi^bffa[1  CJJ~'NO##Iy9DAq"((BFFBFF+;"<=q"((BFFBFF+;"<=	 !   s   "B0D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rO   rR   rS   )rT   r   r   r   r   r  r,   r#  r.   rX  s   & r2   r  "TestTtest_rel.test_bad_alternative.  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  rP   rB   rO   r\   Nr]   N)r   r  r  r  r,   r   r*   r   rj   r   rn  r?  r.   r  rG   r   t_exr  r  r   s   &&      r2   r  TestTtest_rel.test_alternative3  s   JJNNr"NEJJNNqND__Q{C
+>e,e, &&$&&$EEqrxx{3EEqrxx{3+>__Q\\^Q\\^1<>
e,e,r5   r6   N)r7   r8   r9   r:   r  r  r  r  r  r&  r  r   r   rg  r  r;   r<   r=   s   @r2   r  r    sU     $*
86F(>F
 [[]VY,?@- A-r5   r  c                      a  ] tR tRt o 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_indiI  c                h   \         P                  P                  R 4       \         P                  P                  ^^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  r
  res4res5s   &      r2   r  TestTtest_ind.test_vs_nonmaskedJ  s   
		w))//"a(<7 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#r5   c                   \         P                  P                  R 4       \        P                  ! \         P                  P                  ^^4      . RO. RO.R7      p\        4       ;_uu_ 4       pVP                  \        R4       VR,          VR	,          3\         P                  \         P                  .RR.33 Fm  p\        P                  ! V!  w  rE\        V\         P                  \         P                  34       \        V\         P                  \         P                  34       Ko  	  RRR4       R#   + '       g   i     R# ; ir  )r*   r  r>  rj   r   r  r   ro  r   r   r,   r#  r   r  s   &     r2   r  TestTtest_ind.test_fully_maskedg  s    
		w//"))//!Q"7y)>TU  CJJ~'NO!$-766266*S#J79''."1rvvrvv&67"1rvvrvv&67	9 !   r  c                    \         P                  P                  R 4       \         P                  P                  ^^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#  r   r  s   &   r2   r  $TestTtest_ind.test_result_attributesr  r  r5   c                    \         P                  ! . . 4      p\        \        P                  ! \        P
                  ! V4      4      4       R # r  )r,   r#  r   r*   rm  rn  r  s   & r2   r  TestTtest_ind.test_emptyz  r!  r5   c                :   \         P                  ! . RO. RO4      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        4       ;_uu_ 4       pVP                  \        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(   r  NFr;  rk  r  )r,   r#  r   r*   r$  r  r   ro  r   r   r   r%  s   &   r2   r&   TestTtest_ind.test_zero_division~  s   	95bffQi^bffa[1  CJJ~'NO##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r)  r-  r.  s   & r2   r  "TestTtest_ind.test_bad_alternative  r0  r1  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  rP   rB   r4  :re   rf   Nr]   N)r   r  r  r#  r,   r   r*   r   rj   r   rn  r?  r5  s   &&      r2   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,r5   r6   Nr7   r8   r9   r:   r  r  r  r  r&  r  r   r   rg  r  r;   r<   r=   s   @r2   r9  r9  I  sP     $:	86(PF
 [[]VY,?@- A-r5   r9  c                      a  ] tR tRt o 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                $   \         P                  P                  R 4       \         P                  P                  ^^4      . RO,           p\        P
                  ! VR,          ^4      p\        P
                  ! VR,          ^4      p\        W#4       R# )r  Nr  r  )r*   r  r>  r  r   ttest_1sampr,   r   )r.   r	  r  r  s   &   r2   r  !TestTtest_1samp.test_vs_nonmasked  sa    
		w))//"a(<7   2!!'$-3#r5   c                .   \         P                  P                  R 4       \        P                  ! \         P                  P                  ^4      . ROR7      p\         P                  \         P                  3p\        4       ;_uu_ 4       pVP                  \        R4       \         P                  \         P                  3R3VR33 F/  p\        P                  ! V!  w  rV\        Wb4       \        WR4       K1  	  RRR4       R#   + '       g   i     R# ; i)r  r]   r  r   Nr  )r*   r  r>  rj   r   r  r   r   ro  r   r,   rP  r   )r.   r	  r%  rp  r  r  r   s   &      r2   r  !TestTtest_1samp.test_fully_masked  s    
		w//"))//!"49EFFBFF#  CJJ~'NO66266*C07C.A))40"1/"1/ B !   s   	A0DD	c                    \         P                  P                  R 4       \         P                  P                  ^^4      . RO,           p\        P
                  ! VR,          ^4      pRp\        W#RR7       R# )r  Tr   Nr  r  rE  )r*   r  r>  r  r,   rP  r   r  s   &   r2   r  &TestTtest_1samp.test_result_attributes  sP    
		w))//"a(<7  2,
C5r5   c                    \         P                  ! . ^4      p\        \        P                  ! \        P
                  ! V4      4      4       R# )rO   N)r,   rP  r   r*   rm  rn  r  s   & r2   r  TestTtest_1samp.test_empty  s-    !!"a(rxx~&'r5   c                   \         P                  ! . RO^4      w  r\        \        P                  ! V4      V3\        P
                  ^ 34       \        4       ;_uu_ 4       pVP                  \        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(   r  Nrk  )r,   rP  r   r*   r$  r  r   ro  r   r   rn  r   r   r%  s   &   r2   r&  "TestTtest_1samp.test_zero_division  s    !!)Q/bffQi^bffa[1  CJJ~'NO%%i3DABHHQK q266266"23	 !   s    A;C%%C6	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)r*  r  r+  r  Nr,  )r   r   r  r,   rP  r.  s   & r2   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# r3  )r   r  r  rP  r,   r   r*   r   rj   r   rn  r?  )r.   r  rG   r6  r  r  r   s   &&     r2   r   TestTtest_1samp.test_alternative  s    JJNNr3NG&&q!E
!!!QK@e,e, &&$EEqrxx{3&&q||~q3>@
!!!QK@e,e,r5   r6   NrL  r=   s   @r2   rN  rN    sO     $	06(4@
 [[]VY,?@- A-r5   rN  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(   rO   rR   rS   rT   r   )r   r   r(   r   rS   rS   )r(   r(   r(   r(   r(   rO   )r(   r(   rO   rO   r(   r(   g       )r*   rj   r   r,   describer   nobsminmaxmeanvarianceskewnessr   r  )r.   rX   r(  aminamaxs   &    r2   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$6r5   r6   N)r7   r8   r9   r:   r,  rj  r;   r<   r=   s   @r2   r_  r_    s     7 7r5   r_  c                     a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR t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)# )*TestCompareWithStatsi  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  rg   r\   r   r6   r  s   &r2   get_nTestCompareWithStats.get_n  s    !!r5   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# )r  g 7yACg s?Cr]   )r*   r  RandomStater  r  r  rj   r+   )r.   r  r  rG   r   r  ymr^   s   &&      r2   generate_xy_sample'TestCompareWithStats.generate_xy_sample  s     ii##G,IIaL		!WWSVaZ&WWSVaZ&1SV1SVDyUU[[['UU[[['R|r5   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   rt  rj   r+   rn  )
r.   r  nxrG   r   r  rs  r  r  r  s
   &&&       r2   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|r5   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  )ro  rt  r   rQ  r,   r   r*   r   )r.   r  rG   r   r  rs  result1result2s   &       r2   test_linregress$TestCompareWithStats.test_linregress=  sf    A2215LA"&&q,Gll--b5GBJJw/G1DE	 r5   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)ro  rt  r   r   r,   r	   
r.   r  rG   r   r  rs  r   r   rmpms
   &         r2   r   "TestCompareWithStats.test_pearsonrD  s`    A2215LA">>!'DA\\**22FBr2r2 r5   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)ro  rt  r   r   r,   r	   r  s
   &         r2   r  #TestCompareWithStats.test_spearmanrM  s`    A2215LA"??1(DA\\++B3FBr*r* r5   c                r    \         P                  ! ^4      p\        \        \        P
                  WR4       R# )r   FN)r*   r   r$  r  r,   r   r   s   & r2   !test_spearmanr_backcompat_useties6TestCompareWithStats.test_spearmanr_backcompat_usetiesU  s%     IIaLj&"2"2A%@r5   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%<=rB   N)ro  rt  r   rD   r$  r,   r   r.   r  rG   r   r  rs  r   r  s   &       r2   
test_gmeanTestCompareWithStats.test_gmean[  s    A2215LA"CF#A##CG,BA.CF#A##CG,BA. r5   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)ro  rt  r   rJ   r$  r,   r	   r  s   &       r2   
test_hmeanTestCompareWithStats.test_hmeanf  s    A2215LA"CF#A##CG,Br*CF#A##CG,Br* r5   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  )ro  rt  r   r  r,   r	   r  s   &       r2   	test_skewTestCompareWithStats.test_skewr  s|    A2215LA"

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

1A""2&Br* r5   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  )ro  rt  r   r  r,   r	   r  s   &       r2   r   TestCompareWithStats.test_moment~  s|    A2215LA"QA$$R(Br*QA$$R(Br* r5   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# )绽|=rB   N)	ro  rt  re  r  r   r   r)  r,   r  )r.   r  rG   r   r  rs  zxzys   &       r2   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!&( ( r5   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  )ro  rt  r   r  r,   r	   r  s   &       r2   r  "TestCompareWithStats.test_kurtosis  s~    A2215LA"q!A&&r*Br*q!A&&r*Br* r5   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   rs  rj   r+   r   r  r,   r   ro  rt  r	   )
r.   rX   amr   r  r  rG   r   r  rs  s
   &         r2   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 r5   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# )rO   r  r   N)	ro  rt  r   rb  r,   r   r	   r*   r   )	r.   r  rG   r   r  rs  r   r  iis	   &        r2   test_describe"TestCompareWithStats.test_describe  s    A2215LA"qq)A&&r&2BAh#BJJqu$5$&JJrv$6,.0 	 r5   c                x    \         P                  ! \        P                  ! ^4      4      pRp\	        WRR7       R# )r   Tr   N)rc  rd  re  rf  rg  r  )r,   rb  r*   r   r   )r.   r  r  s   &  r2   test_describe_result_attributes4TestCompareWithStats.test_describe_result_attributes  s)    1."
F48r5   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  )ro  rt  r   r   r,   r   r  s   &       r2   test_rankdata"TestCompareWithStats.test_rankdata  sP    A2215LA"q!A&&q)BA"	 r5   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  )ro  rt  r	   r   tmeanr,   r.   r  rG   r   r  rs  s   &     r2   
test_tmeanTestCompareWithStats.test_tmean  sl    A2215LA"Au||/A/A"/ErJAu||/A/A"/ErJ r5   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)ro  rt  r	   r   tmaxr,   r  s   &     r2   	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 r5   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   )ro  rt  r   r   tminr,   r	   r  s   &     r2   	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 r5   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)ro  rt  r   r$  r,   r   r  )r.   r  rG   r   r  rs  r'  zms   &       r2   r&  TestCompareWithStats.test_zmap  s\    A2215LA"

1 A""2*BA!CF|%8	 r5   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   N)ro  rt  r	   r   r  r,   r  s   &     r2   r  #TestCompareWithStats.test_variation  st    A2215LA" 2ELL4J4J24N(*, 2ELL4J4J24N(*,	 r5   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  )ro  rt  r	   r   tvarr,   r  s   &     r2   	test_tvarTestCompareWithStats.test_tvar   sr    A2215LA"

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

1u||/@/@/D(*,	 r5   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.   rX   r&  bms   &   r2   test_trimboth"TestCompareWithStats.test_trimboth  sV    IIbMNN1c"\\""1c*
BGGRWWH$56r5   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   )rm  N)ra  r   )ro  rt  r	   r   tsemr,   r  s   &     r2   	test_tsemTestCompareWithStats.test_tsem  s    A2215LA"

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

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

1Y ? % 1 1"Y 1 G(*, r5   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)ro  rt  r   r  r,   r   r  s   &       r2   test_skewtest"TestCompareWithStats.test_skewtest  sW    A1u#66q9bNN1%\\**2.& r5   c                    \         P                  ! R4      ^,          p\        P                  ! V4      pRp\	        W#RR7       R# r  )r*   r+   r,   r  r   r  s   &   r2   test_skewtest_result_attributes4TestCompareWithStats.test_skewtest_result_attributes"  s3    HH+,a/ooa ,
C5r5   c                $   \         P                  P                  R4      R,          p\        P                  ! V4      p\        P                  P                  V4      p\        \         P                  ! V4      \         P                  ! V4      4       R# )r`   g      4@N)r`   rR   )r*   r  r   r  r,   r   r   )r.   rG   r   r  s   &   r2   test_skewtest_2D_notmasked/TestCompareWithStats.test_skewtest_2D_notmasked(  sW    IIW%+NN1\\""1%

1rzz"~6r5   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# )rR   rP   rB   N)ro  rx  r   r  r,   r   )	r.   rw  r  rG   r   r  rs  r   r  s	   &        r2   test_skewtest_2D_WithMask.TestCompareWithStats.test_skewtest_2D_WithMask/  s    A1u#88?bNN1%\\**2.!QAq>!QAq> r5   c                l   \         P                  ! R R7      ;_uu_ 4        \        4       ;_uu_ 4       pVP                  \        R4       VP                  \        R4       V P                  4        F  pV^8  g   K  V P                  V4      w  r4rV\        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  )overz(`kurtosistest` p-value may be inaccuratez!kurtosistest only valid for n>=20N)r*   ry   r   ro  UserWarningro  rt  r   r  r,   r   r   )	r.   rp  r  rG   r   r  rs  r   r  s	   &        r2   test_normaltest$TestCompareWithStats.test_normaltest:  s    [[g&&(9(;(;sJJ{$NOJJ{$GHZZ\q5#'#:#:1#=LA"((+A004B#BJJqM2::b>B " )<&&(;(;&&&s*   D"AD	<BD	=D"DD""D3	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# )
rO   r,  rB  r]   T)return_countsr   N)rO   rO   rR   rR   rS   rS   rS   rT   rT   rT   rT   )rO   rO   rR   rR   rS   rS   rS   rT   rT   rT   rT   r   r   r   r   )r*   r   r   rj   r+   r   uniquer   r,   find_repeatsr   intp)r.   rG   tmpr^   r  x_origxm_origr  unique_countsr   r  r  r  s   &            r2   test_find_repeats&TestCompareWithStats.test_find_repeatsE  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8r5   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)ro  rt  r   r#  r,   r	   r  s   &       r2   r)  $TestCompareWithStats.test_kendalltauY  sr    A2215LA"  &A((0B!beR8!beQ7 r5   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)ro  rt  r   r0  r,   r	   r5  r  r  s   &       r2   r2  )TestCompareWithStats.test_obrientransforma  sb    A2215LA"%%a(A--b1BR#a&\2	 r5   c                   R EF[  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K^  	  R#   + '       g   i     EKt  ; i)zFChecks that mstats.ks_1samp and stats.ks_1samp agree on masked arrays.r  r  Nautora  asympr	  r  rc  )r   ro  rt  r   ks_1sampr  cdfr,   r   r*   r   r.   r  r  r  rG   r   r  rs  r  r  r
  s   &          r2   test_ks_1samp"TestCompareWithStats.test_ks_1samph  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=E%%E7c                \   R EF  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K(  ; i)zM
Checks that 1-sample mstats.kstest and stats.kstest agree on masked arrays.
r  r  Nr  r  )	r   ro  rt  r   kstestr,   r   r*   r   r  s   &          r2   test_kstest_1samp&TestCompareWithStats.test_kstest_1sampx  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D+c                   R EF+  p\        4       ;_uu_ 4       pVR9   d   RpVP                  \        V4       R F  pV P                  4        F  pV P	                  V4      w  rgr\
        P                  ! WgWAR7      p
\
        P                  P                  WWAR7      p\        \        P                  ! V
4      \        P                  ! V4      4       \
        P                  ! WWAR7      p\        \        P                  ! V
4      \        P                  ! V4      4       K  	  K  	  RRR4       EK.  	  R#   + '       g   i     EKD  ; i)zNChecks that mstats.ks_2samp and stats.ks_2samp agree on masked arrays.
gh-8431)ks_2samp: Exact calculation unsuccessful.r  Nr  r  ra  r  )r   ro  r   ro  rt  r   r8  r,   r   r*   r   r.   r  rp  messager  r  rG   r   r  rs  r  r  r
  s   &            r2   r=  "TestCompareWithStats.test_ks_2samp  s     /D"$$,,IGJJ~w7#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D55Ec                   R EF+  p\        4       ;_uu_ 4       pVR9   d   RpVP                  \        V4       R F  pV P                  4        F  pV P	                  V4      w  rgr\
        P                  ! WgWAR7      p
\
        P                  P                  WWAR7      p\        \        P                  ! V
4      \        P                  ! V4      4       \
        P                  ! WWAR7      p\        \        P                  ! V
4      \        P                  ! V4      4       K  	  K  	  RRR4       EK.  	  R#   + '       g   i     EKD  ; i)zM
Checks that 2-sample mstats.kstest and stats.kstest agree on masked arrays.
r  r  Nr  r  r  )r   ro  r   ro  rt  r   r  r,   r   r*   r   r  s   &            r2   test_kstest_2samp&TestCompareWithStats.test_kstest_2samp  s     /D"$$,,IGJJ~w7#CK!ZZ\'+'>'>q'Ab$||A8C P$||222?J  3  W$RZZ%5rzz$7GH$||B8C P$RZZ%5rzz$7GH * $D	 %$ /$$$r  r6   N),r7   r8   r9   r:   r,  ro  rt  rx  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   @r2   rm  rm    s     ,"F3+A	/
+
+
+($	+M*09#KJ	K9,,7	,'67	?	C9(83I I$I(I Ir5   rm  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	   &        r2   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	6r5   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# )rc  r  r   r	   ҏGw?Nr
  r,   r  r  r  r	   r  r.   r  r  r  r  s   &    r2   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	6r5   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   &    r2   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	6r5   c                    R pRp\        VR9  4       \        \        \        P                  V P
                  V P                  VV4       R# )r   r  Nrb  r   r$  r  r,   r  r  r  r.   r  distributions   &  r2   $test_brunnermunzel_alternative_error6TestBrunnerMunzel.test_brunnermunzel_alternative_error  sA    #CCDj**ffff!"	$r5   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)r"  r   r	  g "H[?Nr
  r  r  s   &    r2   $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	6r5   c                    R pRp\        VR9  4       \        \        \        P                  V P
                  V P                  VV4       R# )rc  r   N)r  r&  r   r!  s   &  r2   %test_brunnermunzel_distribution_error7TestBrunnerMunzel.test_brunnermunzel_distribution_error  s@    !?23j**ffff!"	$r5   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*   rn  )r.   r  r  r  r  r  r  s   &      r2   test_brunnermunzel_empty_imput0TestBrunnerMunzel.test_brunnermunzel_empty_imput  s    %%dffb1%%b$&&1%%b"-r5   r6   N)r7   r8   r9   r:   r*   rj   masked_invalidr   r  r  r  r  r  r  r#  r'  r*  r-  r;   r<   r=   s   @r2   r  r    s     
aAq!RVVQAq!Q266; 	<A
aAq"&&!Q1aAFGAK6.66	$	6	$
 
r5   r  )NNgHz>)Cr,  r   rd  numpyr*   r   numpy.marj   r   r   scipy.stats.mstatsr   r,   scipycommon_testsr   r   r   r$  numpy.ma.testutilsr   r	   r
   r   r   r   r   numpy.testingr   scipy.statsr   r   scipy.conftestr   scipy.stats._axis_nan_policyr   r   r   rH   rK   rM   r   r   r   rj  r  r  r  r  r.  rV  rY  r[  r  r  r  r  r  r  r  r  r  r9  rN  r_  rm  r  r6   r5   r2   <module>r:     s        # # #  -  *E E E , 0 . R- -*!! 93 93 93x !3 !3 !3H9 9,y6 y6x	 u: u: u:p V/ V/ V/r& &RA A* 4 4 4@ -9 -9 -9`F, J1 J1Z8:.8*E _8 _8 _8D6 6.2 .2b6 6Y- Y-x\- \-~@- @-F7 70 mI mI mI`c cr5   