+
    0i(2                        ^ RI t ^ RIt^ RIHt ^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHtHtHt ]P"                  P$                  t]! ]P&                  4       ! R R4      4       t]! ]P*                  4       ! R	 R
4      4       tR# )    N)raises)stats)normexpon)make_xp_test_case)xp_assert_closexp_assert_equalxp_assert_lessc                   z   a  ] tR t^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V tR# )TestEntropyc                   VP                  . RO4      pVP                  . RO4      p\        P                  ! W"4      p\        P                  ! W#4      p\        WAP                  R4      4       \	        V) VP                  R4      4       R# )      ?        N)r   皙?333333?)皙?g      ?g?)asarrayr   entropyr	   r
   )selfxppkqkeselfedoubles   &&    \/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/stats/tests/test_entropy.pytest_entropy_positive!TestEntropy.test_entropy_positive   s_    ZZ(ZZ)*b%--'zz"~.xB0    c                   VP                  ^4      p\        P                  ! VRR7      p\        VP	                  VR,
          4      VP                  R4      4       VP                  ^4      pVP                  VP                  ^4      ^8  RV4      p\        P                  ! W$4      p\        P                  ! W$RR7      p\        VP	                  W5,          \        P                  ! R4      ,
          4      VP                  R4      4       R# )          @baseg      @gh㈵>N)
onesr   r   r
   absr   wherearangemathlog)r   r   r   Sr   S2s   &&    r   test_entropy_baseTestEntropy.test_entropy_base   s    WWR[MM"2&rvva"f~rzz%'89WWR[XXbiima'R0MM"!]]2+rvvadTXXb\12BJJu4EFr   c                    VP                  . RO4      p\        \        P                  ! V4      VP                  R4      4       R# )r   g R^?N)r         ?r!   r   r   r   r   )r   r   xs   && r   test_entropy_zeroTestEntropy.test_entropy_zero&   s0    JJ|$a(

#67	9r   c                    VP                  R R.RR.RR..4      pVP                  RR .RR.RR..4      p\        \        P                  ! W#4      VP                  RR.4      4       R# )r   r   333333?r   r   gN!0?2?Nr0   r   r   r   r   s   &&  r   test_entropy_2dTestEntropy.test_entropy_2d,   sh    ZZ#sc3Z#s<=ZZ#sc3Z#s<=b-

Iz#:;	=r   c                z   VP                  R R.RR.RR..4      pVP                  RR .RR.RR..4      p\        \        P                  ! W#4      VP                  VP                  R.4      4       VP                  RR.RR.RR..4      p\        \        P                  ! W#4      VP                  RR.4      4       R# )	r   r   r5   r   r   r   r6   g^fTF?N)r   r   r   r   infr7   s   &&  r   test_entropy_2d_zero TestEntropy.test_entropy_2d_zero2   s    ZZ#sc3Z#s<=ZZ#sc3Z#s<=b-

BFFJ#78	: ZZ#sc3Z#s<=b-

J
#;<	>r   c                    VP                  R R.RR.RR..4      p\        \        P                  ! V^R7      VP                  . RO4      4       R# )r   r   r5   r   r   axisN)R^?rA   gD%+?r0   r   r   r   s   && r   $test_entropy_base_2d_nondefault_axis0TestEntropy.test_entropy_base_2d_nondefault_axis<   sF    ZZ#sc3Z#s<=bq1

#GH	Jr   c                    VP                  R R.RR.RR..4      pVP                  RR .RR.RR..4      p\        \        P                  ! W#^R7      VP                  . RO4      4       R# )r   r   r5   r   r   r?   N){[<?rF   gC8X?r0   r7   s   &&  r   test_entropy_2d_nondefault_axis+TestEntropy.test_entropy_2d_nondefault_axisA   sg    ZZ#sc3Z#s<=ZZ#sc3Z#s<=b15

#GH	Jr   c                   VP                  R R.RR.RR..4      pVP                  R R.RR..4      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! W#4       RRR4       R#   + '       g   i     R# ; i)r   r   r5   r   r   /Array shapes are incompatible for broadcasting.matchN)r   pytestr   
ValueErrorr   r   )r   r   r   r   messages   &&   r   test_entropy_raises_value_error+TestEntropy.test_entropy_raises_value_errorG   so    ZZ#sc3Z#s<=ZZ#sc3Z01C]]:W55MM"! 6555s   A99B
	c                    VP                  R R.RR.RR..4      p\        \        P                  ! V^ R7      \        P                  ! V4      4       R# r   r   r5   r   r   r?   Nr0   rB   s   && r   1test_base_entropy_with_axis_0_is_equal_to_default=TestEntropy.test_base_entropy_with_axis_0_is_equal_to_defaultN   sD    ZZ#sc3Z#s<=bq1b)	+r   c                    VP                  R R.RR.RR..4      pVP                  RR .RR.RR..4      p\        \        P                  ! W#^ R7      \        P                  ! W#4      4       R# rS   r0   r7   s   &&  r   ,test_entropy_with_axis_0_is_equal_to_default8TestEntropy.test_entropy_with_axis_0_is_equal_to_defaultS   se    ZZ#sc3Z#s<=ZZ#sc3Z#s<=b15b-	/r   c                    VP                  R R.RR.RR..4      p\        \        P                  ! VP                  4      \        P                  ! V^R7      4       R# rS   r   r   r   r   TrB   s   && r   test_base_entropy_transposed(TestEntropy.test_base_entropy_transposedY   sH    ZZ#sc3Z#s<=bdd+bq1	3r   c           	        VP                  R R.RR.RR..4      pVP                  RR .RR.RR..4      p\        \        P                  ! VP                  VP                  4      \        P                  ! W#^R7      4       R# rS   rZ   r7   s   &&  r   test_entropy_transposed#TestEntropy.test_entropy_transposed^   so    ZZ#sc3Z#s<=ZZ#sc3Z#s<=bddBDD1b15	7r   c                   \         P                  P                  R 4      pVP                  VP                  ^4      4      pVP                  VP                  R4      4      p\        P
                  ! W4RR7      p\        V^ ,          \        P
                  ! W4R,          4      4       \        V^,          \        P
                  ! W4R,          4      4       R# )l   @UC<r?   N)      )r   .)rc   .)nprandomdefault_rngr   r   r   r	   )r   r   rngr1   yress   &&    r   test_entropy_broadcasting%TestEntropy.test_entropy_broadcastingd   s    ii##$56JJszz!}%JJszz&)*mmAr*Aa6 ;<Aa6 ;<r   c                    VP                  R4      pVP                  R4      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! W#4       RRR4       R#   + '       g   i     R# ; i)
   rJ   rK   N)rn   rc      )   rb   r$   rM   r   rN   r   r   )r   r   r1   ri   rO   s   &&   r   test_entropy_shape_mismatch'TestEntropy.test_entropy_shape_mismatchl   sO    GGK GGGC]]:W55MM! 6555s   	A**A;	c                    VP                  ^
4      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! VRR7       RRR4       R#   + '       g   i     R# ; i)rn   z!`base` must be a positive number.rK   r"   Nrq   r   r   r1   rO   s   &&  r   test_input_validation!TestEntropy.test_input_validations   sB    GGBK5]]:W55MM!"% 6555s   AA,	 N)__name__
__module____qualname____firstlineno__r   r,   r2   r8   r<   rC   rG   rP   rT   rW   r\   r_   rk   rr   rw   __static_attributes____classdictcell____classdict__s   @r   r   r      sX     1	G9=>J
J"+
/3
7= & &r   r   c                     a  ] tR t^zt o Rt]P                  P                  RRR]P                  ! R]	! RRR7      ]	! R	RR7      .R
7      R.4      t
R tR tR tR tR tR tR t]
R 4       tRRRRRRRR/tRR RR!RR"RR#/t]]]]/t]
]P                  P                  R]].4      R 4       4       t]P                  P                  R. R$O4      R 4       t]
]P                  P                  R. R%O4      R 4       4       tRtV tR# )&TestDifferentialEntropyz
Vasicek results are compared with the R package vsgoftest.

# library(vsgoftest)
#
# samp <- c(<values>)
# entropy.estimate(x = samp, window = <window_length>)

methodvasicekvan escorreaarray_api_strictzInvalid fancy indexing)reasonz
dask.array)marksebrahimic                   \         P                  P                  ^ 4      pVP                  ^d4      pVP	                  VP                  4       4      p\        P                  ! VRR7      p\        WAP	                  R4      4       \        P                  ! V^RR7      p\        WAP	                  R4      4       \        P                  ! V^RR7      p\        WAP	                  R4      4       R# )r   r   r   - {?)window_lengthr    ?=&?N	re   rf   RandomStatestandard_normalr   tolistr   differential_entropyr   )r   r   random_statevaluesr   s   &&   r   !test_differential_entropy_vasicek9TestDifferentialEntropy.test_differential_entropy_vasicek   s    yy,,Q/--c2FMMO,,,VIF,=!>?,,V14=?,=!>?,,V14=?,=!>?r   c                   \         P                  P                  ^ 4      pVP                  R4      pVP	                  VP                  4       4      p\        P                  ! V^RR7      pVP	                  . RO4      p\        WE4       \        P                  ! V^^RR7      pVP	                  . RO4      p\        WE4       \        P                  ! V^^RR7      pVP	                  . RO4      p\        WE4       R# )	r   r   )r@   r   )r@   r   r   N   d   )r   gUZdpx?gE7L?)r   gzG?gt?)r   gl+ɍj?go4d?r   )r   r   r   r   r   refs   &&    r   4test_differential_entropy_vasicek_2d_nondefault_axisLTestDifferentialEntropy.test_differential_entropy_vasicek_2d_nondefault_axis   s    yy,,Q/--h7FMMO,,,V!INjjRS%,,V!14=?jjQR%,,V!14=?jjRS%r   c           	        \         P                  P                  ^ 4      pVP                  R4      pVP	                  VP                  4       4      pRpVP                  ^,          pR^ V^,          V0 FQ  pVP                  VVR7      p\        \        VR7      ;_uu_ 4        \        P                  ! VV^R7       RRR4       KS  	  R#   + '       g   i     Kh  ; i)r   zhWindow length \({window_length}\) must be positive and less than half the sample size \({sample_size}\).)r   sample_sizerK   )r   r@   Nr   rd   )re   rf   r   r   r   r   shapeformatassert_raisesrN   r   r   )r   r   r   r   	error_strr   r   formatted_error_strs   &&      r   ,test_differential_entropy_raises_value_errorDTestDifferentialEntropy.test_differential_entropy_raises_value_error   s    yy,,Q/--h7FMMO,< 	
 ll1o ![!^[AM"+"2"2+' #3 #
 z1DEE**"/ FE B FEEs   !C		Cc                   \         P                  P                  ^ 4      pVP                  R4      pVP	                  VP                  4       4      p\        P                  ! V^ R7      p\        P                  ! V4      p\        WE4       R# )r   r?   N)r   r   r   )r   r   r   r   r   default_entropys   &&    r   >test_base_differential_entropy_with_axis_0_is_equal_to_defaultVTestDifferentialEntropy.test_base_differential_entropy_with_axis_0_is_equal_to_default   sd    yy,,Q/--h7FMMO,,,V!<44V<1r   c                $   \         P                  P                  ^ 4      pVP                  R4      pVP	                  VP                  4       4      p\        \        P                  ! VP                  4      \        P                  ! V^R7      4       R# )r   r?   Nr   )
re   rf   r   r   r   r   r   r   r   r[   )r   r   r   r   s   &&  r   )test_base_differential_entropy_transposedATestDifferentialEntropy.test_base_differential_entropy_transposed   sd    yy,,Q/--h7FMMO,&&vxx0&&vA6	
r   c                   \         P                  ! ^
4      pVP                  VP                  4       4      pRp\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! VRR7       RRR4       Rp\        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! VRR7       RRR4       R#   + '       g   i     LY; i  + '       g   i     R# ; i)	rn   z+`base` must be a positive number or `None`.rK   r"   Nz`method` must be one of...z	ekki-ekkir   ru   )	re   r$   r   r   rM   r   rN   r   r   rv   s   &&  r   rw   -TestDifferentialEntropy.test_input_validation   s    GGBKJJqxxz"?]]:W55&&qr2 6 /]]:W55&&q= 65	 65 655s   C#CC	C*	c                    \         P                  P                  R 4      pVP                  VP                  ^
R7      4      p\        P
                  ! V4      p\        P
                  ! VRR7      p\        WTRR7       R# )l   eY')sizeN)r   {Gzt?rtol)re   rf   rg   r   r   r   r   )r   r   rh   r1   r   rj   s   &&    r   test_window_length_is_none2TestDifferentialEntropy.test_window_length_is_none   s\    ii##$67JJszzrz*+((+(($?u-r   c                P   VR 8X  d   RMRp\         P                  P                  V^ R7      pVP                  VP	                  4       4      pVP                  \        \         P                  P                  4       4      4      p\         P                  ! WAR7      p\        WeRR7       R# )r   '  i@B r   r   r   r   r   N)	r   r   rvsr   r   floatr   r   r   )r   r   r   nr   expectedrj   s   &&&    r   test_consistency(TestDifferentialEntropy.test_consistency   sv     x'EWjjnn!!n4jj&::eEJJ$6$6$89:((<E2r   distc                :   R ^2^repV P                   V,          V,          pVP                  V^ ,          4      VP                  V^,          4      rVP                  WE3^ R7      p
VP                  V
P                  4       4      p
VP                  \	        VP                  4       4      4      p\        P                  ! WVRR7      p\        VP                  VP                  W,
          ^,          4      4      VRR7       \        VP                  V^ R7      V	RR7       R# )	r   r   )r   r   r@   r   )atol)
correctiongMb`?Nrd   )rmse_std_casesr   r   r   r   r   r   r   r   sqrtmeanstd)r   r   r   r   repsr   mr   rmse_expectedstd_expectedr   true_entropyrj   s   &&&&         r   test_rmse_std%TestDifferentialEntropy.test_rmse_std  s     B&&t,V4&(jj!&=rzz(ST+?V|hhTIAh6jj&zz%"78((06RA);a(? @A%E	3sq1<eLr   z	n, methodc                    \         P                  P                  V3^ R7      pVP                  VP	                  4       4      p\         P
                  ! V4      p\         P
                  ! WBR7      p\        WV4       R# )r   r   r   N)r   r   r   r   r   r   r	   )r   r   r   r   r   res1res2s   &&&&   r   test_method_auto(TestDifferentialEntropy.test_method_auto&  sX     jjnn1$Qn7jj&))#.))#=#r   dtypeNc                   . ROp\        V\        V4      R4      p\        V\        V4      VP                  R4      P                  4      p\        P
                  ! VP                  WER7      VR7      p\        P
                  ! VP                  WAP                  R7      VR7      p\        WqP                  WR7      R,          4       R# )rc   Nr/   )r   r   )rc   rc   rb   r   r         r            	   rn   rp   ry   )getattrstrr   r   r   r   float64r   )	r   r   r   r   r1   dtype_in	dtype_outrj   r   s	   &&&&     r   test_dtypes_gh21192+TestDifferentialEntropy.test_dtypes_gh211922  s     92s5z40BE
BJJrN,@,@A	((A)FvV((AZZ)HQWXZZZ=bABr   ry   )gMbX?灕Cl?)gA`"?g)\(?)gHzG?gy&1?)gMb?r   )gE?l?)gx?gOn?)gףp=
?g~jt?)gS?r   ))r   r   )ro   r   )i  r   )Nfloat32r   )rz   r{   r|   r}   __doc__rM   markparametrizeparamskip_xp_backendsmethodsr   r   r   r   r   rw   r   r   norm_rmse_std_casesexpon_rmse_std_casesr   r   r   r   r   r   r~   r   r   s   @r   r   r   z   st     kk%%h !3<TU 6NO	
 	1 G@"&(42

>. 3 3 %n#^#^%~	 &~$n$n&	 /13N [[VdE]3M 4 M  [[[ + 
$
$ [[W&BC	C D 	Cr   r   )r(   rM   r   r   numpyre   scipyr   scipy.statsr   r   scipy._lib._array_apir   scipy._lib._array_api_no_0dr   r	   r
   r   r   r   r   r   r   ry   r   r   <module>r      s      *   # 39 9 ;;// 5==!f& f& "f&R 5--.BC BC /BCr   