
    (ph                         S SK rS SK Jr  S SKJr  / SQr/ SQr\" \SSS2   5      r\" \SSS2   5      rS r	/ SQr
/ S	Qr\" \
SSS2   5      r\" \SSS2   5      rS
 rg)    N)poly1d)beta)gSbQ
@go|-a?g_3
L/g|A"?gCUG)      ?g<*x@g y@g`B{dA?g-~?c                 ^   [         R                  " U 5      n U R                  n[         R                  " U 5      R	                  [         R
                  5      n SnU S:  nU S:H  n[         R                  " U 5      U:  nX4-  U-  ) nX   nX   n[         R                  " U 5      n	[         R                  X'   [         R                  X'   UR                  S:  a  [        U5      [        U5      -  X'   UR                  S:  a)  SUS-  -  SSSU-  -   -  [        US-   US-   5      -
  -  X'   Xl        U	$ )a  Variance of the Tukey Lambda distribution.

Parameters
----------
lam : array_like
    The lambda values at which to compute the variance.

Returns
-------
v : ndarray
    The variance.  For lam < -0.5, the variance is not defined, so
    np.nan is returned.  For lam = 0.5, np.inf is returned.

Notes
-----
In an interval around lambda=0, this function uses the [4,4] Pade
approximation to compute the variance.  Otherwise it uses the standard
formula (https://en.wikipedia.org/wiki/Tukey_lambda_distribution).  The
Pade approximation is used because the standard formula has a removable
discontinuity at lambda = 0, and does not produce accurate numerical
results near lambda = 0.
g333333?g      r   g       @   r      )npasarrayshape
atleast_1dastypefloat64abs
empty_likenaninfsize_tukeylambda_var_p_tukeylambda_var_qr   )
lamshp	thresholdlow_maskneghalf_mask
small_maskreg_masksmallregvs
             Q/var/www/html/venv/lib/python3.13/site-packages/scipy/stats/_tukeylambda_stats.pytukeylambda_variancer"   +   s   . **S/C
))C
--

#
#BJJ
/C I
 TzH$;Ly(J(:56H OE
-C 	cA&&AKffAOzzA~*514Fu4MM
xx!|S!V|sQW}(=(,S1WcAg(>)? @GH    )g333333?g6|igeSH6gѐ환^?g˝)kPd@)r   g?ݻA@gID@)@gPr?g`2fQc                    [         R                  " U 5      n U R                  n[         R                  " U 5      R	                  [         R
                  5      n SnU S:  nU S:H  n[         R                  " U 5      U:  nX4-  U-  ) nX   nX   n[         R                  " U 5      n	[         R                  X'   [         R                  X'   UR                  S:  a  [        U5      [        U5      -  X'   UR                  S:  am  SSU-  S-   -  S[        SU-  S-   US-   5      -  -
  S[        SU-  S-   SU-  S-   5      -  -   n
SSSU-  S-   -  [        US-   US-   5      -
  S-  -  nX-  S-
  X'   Xl        U	$ )	a*  Kurtosis of the Tukey Lambda distribution.

Parameters
----------
lam : array_like
    The lambda values at which to compute the variance.

Returns
-------
v : ndarray
    The variance.  For lam < -0.25, the variance is not defined, so
    np.nan is returned.  For lam = 0.25, np.inf is returned.

g)\(?g      пr   r      r	      r   )r
   r   r   r   r   r   r   r   r   r   r   _tukeylambda_kurt_p_tukeylambda_kurt_qr   )r   r   r   r   negqrtr_maskr   r   r   r   knumerdenoms               r!   tukeylambda_kurtosisr-      st    **S/C
))C
--

#
#BJJ
/C I U{H%<Ly(J(:56H OE
-C 	cA&&AKffAOzzA~+E25H5OO
xx!|C!$q4C!S1W+E'EET!c'A+q3w{334S!c'A+&cAgsQw)??!CCma' GHr#   )numpyr
   r   scipy.specialr   _tukeylambda_var_pc_tukeylambda_var_qcr   r   r"   _tukeylambda_kurt_pc_tukeylambda_kurt_qcr'   r(   r-    r#   r!   <module>r5      s      8- ? 
 /"56 /"56 9z? A 
 1$B$78 1$B$78 4r#   