
    9i@?                     L   S SK r S SKrS SKJr  S SKJr  S SKJrJrJ	r	J
r
JrJrJr  / SQr " S S\5      rS r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\ R,                  \   R0                  r\ H  r\" \\   5      \\   l        M     g)    N)inf)special)ContinuousDistributionDiscreteDistribution_RealInterval_IntegerInterval_RealParameter_Parameterization_combine_docs)NormalUniformBinomialc                     ^  \ rS rSrSr\" \* \4S9r\" S\4S9r\" \* \4S9r	\
" SS\SS9r\
" S	S
\SS9r\
" S\	SS9r\" \\5      /r\rS\R$                  " S\R&                  -  5      -  r\R*                  " S\R&                  -  5      S-  rS'U 4S jjrSSS.U 4S jjrS rS rS rS rS rS rS rS r S r!S r"S r#S  r$S! r%S" r&S# r'SS/\'l(        S$ r)S% r*S&r+U =r,$ )(r      a  Normal distribution with prescribed mean and standard deviation.

The probability density function of the normal distribution is:

.. math::

    f(x) = \frac{1}{\sigma \sqrt{2 \pi}} \exp {
        \left( -\frac{1}{2}\left( \frac{x - \mu}{\sigma} \right)^2 \right)}

	endpointsr   muz\mu)   symboldomaintypicalsigmaz\sigma)      ?g      ?xr   r   r      c                 T   > Uc  Uc  [         TU ]  [        5      $ [         TU ]  U 5      $ N)super__new__StandardNormal)clsr   r   kwargs	__class__s       ^/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/scipy/stats/_new_distributions.pyr"   Normal.__new__,   s*    :%-7?>22ws##                  ?r   r   c                *   > [         TU ]  " SXS.UD6  g )Nr,    r!   __init__)selfr   r   r%   r&   s       r'   r0   Normal.__init__1   s    6B6v6r)   c                f    [         R                  XU-
  U-  5      [        R                  " U5      -
  $ r    )r#   _logpdf_formulanplogr1   r   r   r   r%   s        r'   r4   Normal._logpdf_formula4   s(    --dVUNCbffUmSSr)   c                >    [         R                  XU-
  U-  5      U-  $ r    )r#   _pdf_formular7   s        r'   r:   Normal._pdf_formula7   s     **4b&%@5HHr)   c                8    [         R                  XU-
  U-  5      $ r    )r#   _logcdf_formular7   s        r'   r=   Normal._logcdf_formula:   s    --dVUNCCr)   c                8    [         R                  XU-
  U-  5      $ r    )r#   _cdf_formular7   s        r'   r@   Normal._cdf_formula=   s    **4b&%@@r)   c                8    [         R                  XU-
  U-  5      $ r    )r#   _logccdf_formular7   s        r'   rC   Normal._logccdf_formula@   s    ..t"fe^DDr)   c                8    [         R                  XU-
  U-  5      $ r    )r#   _ccdf_formular7   s        r'   rF   Normal._ccdf_formulaC   s    ++Dr65.AAr)   c                8    [         R                  X5      U-  U-   $ r    )r#   _icdf_formular7   s        r'   rI   Normal._icdf_formulaF   s    ++D4u<rAAr)   c                8    [         R                  X5      U-  U-   $ r    )r#   _ilogcdf_formular7   s        r'   rL   Normal._ilogcdf_formulaI   s    ..t7%?"DDr)   c                8    [         R                  X5      U-  U-   $ r    )r#   _iccdf_formular7   s        r'   rO   Normal._iccdf_formulaL   s    ,,T5=BBr)   c                8    [         R                  X5      U-  U-   $ r    )r#   _ilogccdf_formular7   s        r'   rR   Normal._ilogccdf_formulaO   s    //85@2EEr)   c                l    [         R                  U 5      [        R                  " [	        U5      5      -   $ r    )r#   _entropy_formular5   r6   absr1   r   r   r%   s       r'   rU   Normal._entropy_formulaR   s%    ..t4rvvc%j7IIIr)   c                H   [         R                  U 5      n[        R                  " SS9   [        R                  " [        R                  " [        U5      5      S-   5      nS S S 5        [        R                  " [        R                  " UW5      SS9$ ! , (       d  f       N8= f)Nignoredividey                r   axis)	r#   _logentropy_formular5   errstater6   rV   r   	logsumexpbroadcast_arrays)r1   r   r   r%   lH0llss         r'   r_   Normal._logentropy_formulaU   sp    006[[) &&E
+B./C *   !4!4S#!>QGG	 *)s   7B
B!c                    U$ r    r.   rW   s       r'   _median_formulaNormal._median_formula]       	r)   c                    U$ r    r.   rW   s       r'   _mode_formulaNormal._mode_formula`   ri   r)   c                L    US:X  a  [         R                  " U5      $ US:X  a  U$ g )Nr   r   )r5   	ones_liker1   orderr   r   r%   s        r'   _moment_raw_formulaNormal._moment_raw_formulac   s'    A:<<##aZIr)   c                    US:X  a  [         R                  " U5      $ US-  (       a  [         R                  " U5      $ X1-  [        R                  " [        U5      S-
  SS9-  $ )Nr   r   r   T)exact)r5   rn   
zeros_liker   
factorial2intro   s        r'   _moment_central_formulaNormal._moment_central_formulal   sR    A:<<##QY==$$ <'"4"4SZ!^4"PPPr)   c                (    UR                  X4US9S   $ )N)locscalesizer.   normal)r1   
full_shaperngr   r   r%   s         r'   _sample_formulaNormal._sample_formulau   s    zzbJz?CCr)   r.   )NN)-__name__
__module____qualname____firstlineno____doc__r   r   
_mu_domain_sigma_domain
_x_supportr	   	_mu_param_sigma_param_x_paramr
   _parameterizations	_variabler5   sqrtpi_normalizationr6   _log_normalizationr"   r0   r4   r:   r=   r@   rC   rF   rI   rL   rO   rR   rU   r_   rg   rk   rq   ordersrx   r   __static_attributes____classcell__r&   s   @r'   r   r      sE   	 3$5J!QH5M3$5JtVJ'.0I!')M*46Lc*gFH+I|DEIrwwqw''N"%%*$
  r 7 7TIDAEBBECFJH #$QQD Dr)   r   c                 V    [         R                  " X[        R                  S-  -   /SS9$ )Ny              ?r   r]   )r   ra   r5   r   )log_plog_qs     r'   	_log_diffr   y   s$    e2558^41==r)   c                      \ rS rSrSr\" \* \4S9r\" S\SS9r	\	r
/ rS\R                  " S\R                  -  5      -  r\R                   " S\R                  -  5      S-  r\R$                  " S	5      r\R$                  " S
5      rS rS rS rS rS rS rS rS rS rS rS rS r S r!S r"S r#S r$S r%S r&S r'Sr(g) r#   }   zStandard normal distribution.

The probability density function of the standard normal distribution is:

.. math::

    f(x) = \frac{1}{\sqrt{2 \pi}} \exp \left( -\frac{1}{2} x^2 \right)

r   r   )   r   r   r   r*   r+   c                 2    [         R                  " U 40 UD6  g r    )r   r0   r1   r%   s     r'   r0   StandardNormal.__init__   s    ''77r)   c                 .    U R                   US-  S-  -   * $ Nr   )r   r1   r   r%   s      r'   r4   StandardNormal._logpdf_formula   s    ((1a46122r)   c                 V    U R                   [        R                  " US-  * S-  5      -  $ r   )r   r5   expr   s      r'   r:   StandardNormal._pdf_formula   s%    ""RVVQTE!G_44r)   c                 .    [         R                  " U5      $ r    r   log_ndtrr   s      r'   r=   StandardNormal._logcdf_formula   s    ""r)   c                 .    [         R                  " U5      $ r    r   ndtrr   s      r'   r@   StandardNormal._cdf_formula   s    ||Ar)   c                 0    [         R                  " U* 5      $ r    r   r   s      r'   rC   StandardNormal._logccdf_formula   s    ##r)   c                 0    [         R                  " U* 5      $ r    r   r   s      r'   rF   StandardNormal._ccdf_formula   s    ||QBr)   c                 .    [         R                  " U5      $ r    r   ndtrir   s      r'   rI   StandardNormal._icdf_formula   s    }}Qr)   c                 .    [         R                  " U5      $ r    r   	ndtri_expr   s      r'   rL   StandardNormal._ilogcdf_formula   s      ##r)   c                 0    [         R                  " U5      * $ r    r   r   s      r'   rO   StandardNormal._iccdf_formula   s    a   r)   c                 0    [         R                  " U5      * $ r    r   r   s      r'   rR    StandardNormal._ilogccdf_formula   s    !!!$$$r)   c                 \    S[         R                  " S[         R                  -  5      -   S-  $ Nr   r   )r5   r6   r   r   s     r'   rU   StandardNormal._entropy_formula   s"    BFF1RUU7O#Q&&r)   c                     [         R                  " [         R                  " S[         R                  -  5      5      [         R                  " S5      -
  $ r   )r5   log1pr6   r   r   s     r'   r_   "StandardNormal._logentropy_formula   s.    xxqw(266!944r)   c                     gNr   r.   r   s     r'   rg   StandardNormal._median_formula       r)   c                     gr   r.   r   s     r'   rk   StandardNormal._mode_formula   r   r)   c                 8    SSSSSSS.nUR                  US 5      $ )Nr   r      )r   r   r   r      r   )get)r1   rp   r%   raw_momentss       r'   rq   "StandardNormal._moment_raw_formula   s%    aA!:ud++r)   c                 (    U R                   " U40 UD6$ r    rq   r1   rp   r%   s      r'   rx   &StandardNormal._moment_central_formula       ''888r)   c                 (    U R                   " U40 UD6$ r    r   r   s      r'   _moment_standardized_formula+StandardNormal._moment_standardized_formula   r   r)   c                 &    UR                  US9S   $ )Nr}   r.   r~   )r1   r   r   r%   s       r'   r   StandardNormal._sample_formula   s    zzzz*2..r)   r.   N))r   r   r   r   r   r   r   r   r	   r   r   r   r5   r   r   r   r6   r   float64r   r   r0   r4   r:   r=   r@   rC   rF   rI   rL   rO   rR   rU   r_   rg   rk   rq   rx   r   r   r   r.   r)   r'   r#   r#   }   s     3$5Jc*gFHIrwwqw''N"%%*	BBJJrNE835#$  $!%'5,99/r)   r#   c                     ^  \ rS rSrSr\" S\4S9r\" S\4S9r\" \* \4S9r	\" S\4S9r
\" SSS	9r\" S\S
S9r\" S\SS9r\" SS\	SS9r\" SS\
SS9r\" S\SS9r\R%                  \5        \
R%                  \5        \R%                  \\5        \" \\5      \" \\5      /r\rSSSSS.U 4S jjrSS jrS rS rSrU =r$ )_LogUniform   a  Log-uniform distribution.

The probability density function of the log-uniform distribution is:

.. math::

    f(x; a, b) = \frac{1}
                      {x (\log(b) - \log(a))}

If :math:`\log(X)` is a random variable that follows a uniform distribution
between :math:`\log(a)` and :math:`\log(b)`, then :math:`X` is log-uniformly
distributed with shape parameters :math:`a` and :math:`b`.

r   r   alog_ar   bTTr   	inclusivegMbP?g?r   r   g?g     @@z\log(a))gr   log_bz\log(b))皙?r   r   Nr   r   r   r   c                ,   > [         TU ]  " SXX4S.UD6  g )Nr   r.   r/   )r1   r   r   r   r   r%   r&   s         r'   r0   _LogUniform.__init__   s    F1FvFr)   c           	         Uc  [         R                  " U5      OUnUc  [         R                  " U5      OUnUc  [         R                  " U5      OUnUc  [         R                  " U5      OUnUR                  [	        XX4S95        U$ )Nr   )r5   r   r6   updatedict)r1   r   r   r   r   r%   s         r'   _process_parameters_LogUniform._process_parameters   sf    YBFF5MAYBFF5MA"]q	"]q	dQ5>?r)   c                    X2-
  U-  S-  $ )Nr   r.   )r1   r   r   r   r%   s        r'   r:   _LogUniform._pdf_formula   s    !B&&r)   c           	          US:X  a  U R                   $ U R                   X2-
  -  U-  n[        R                  " [        R                  " [	        X-  X-  5      5      5      nXV-  $ r   )_oner5   realr   r   )r1   rp   r   r   r%   t1t2s          r'   rq   _LogUniform._moment_raw_formula  sQ    A:99YY%-(50WWRVVIemU]CDEwr)   r.   )NNNN)r   r   r   r   r   r   r   	_a_domain	_b_domain_log_a_domain_log_b_domainr   r	   _a_param_b_param_log_a_param_log_b_paramr   define_parametersr
   r   r   r0   r   r:   rq   r   r   r   s   @r'   r   r      s    C1Ic
3I!cT3K8M!WcN;M|LJc)[IHc)ZHH!'*)6
LL!'*)6JLc*jIH)##L1  84+L,G+Hh?AI DD G G' r)   r   c                   b  ^  \ rS rSrSr\" \* \4S9r\" S\4S9r\" SSS9r	\
" S\SS	9r\
" S
\SS	9r\
" S\	SS	9r\R                  \5        \	R                  \\5        \" \\5      /r\rSSS.U 4S jjrS S jrS rS rS rS rS rS rS rS rS rS rS rS rS r S/\ l!        S r"Sr#U =r$$ )!r   i  zUniform distribution.

The probability density function of the uniform distribution is:

.. math::

    f(x; a, b) = \frac{1}
                      {b - a}

r   r   r   r   r   r   r   r   r   r   Nc                *   > [         TU ]  " SXS.UD6  g )Nr   r.   r/   )r1   r   r   r%   r&   s       r'   r0   Uniform.__init__(      ,1,V,r)   c                 @    X!-
  nUR                  [        XUS95        U$ )N)r   r   ab)r   r   r1   r   r   r  r%   s        r'   r   Uniform._process_parameters+  s!    UdQ+,r)   c                    [         R                  " [         R                  " U5      [         R                  [         R                  " U5      * 5      $ r    )r5   whereisnannanr6   r1   r   r  r%   s       r'   r4   Uniform._logpdf_formula0  s+    xxRVVbffRj[99r)   c                |    [         R                  " [         R                  " U5      [         R                  SU-  5      $ Nr   )r5   r  r  r  r  s       r'   r:   Uniform._pdf_formula3  s%    xxRVVQrT22r)   c                    [         R                  " SS9   [         R                  " X-
  5      [         R                  " U5      -
  sS S S 5        $ ! , (       d  f       g = fNrZ   r[   r5   r`   r6   r1   r   r   r  r%   s        r'   r=   Uniform._logcdf_formula6  4    [[)66!%=266":- *))   /A
Ac                    X-
  U-  $ r    r.   r  s        r'   r@   Uniform._cdf_formula:      |r)   c                    [         R                  " SS9   [         R                  " X!-
  5      [         R                  " U5      -
  sS S S 5        $ ! , (       d  f       g = fr  r  r1   r   r   r  r%   s        r'   rC   Uniform._logccdf_formula=  r  r   c                    X!-
  U-  $ r    r.   r%  s        r'   rF   Uniform._ccdf_formulaA  r#  r)   c                    X#U-  -   $ r    r.   )r1   pr   r  r%   s        r'   rI   Uniform._icdf_formulaD      a4xr)   c                    X#U-  -
  $ r    r.   )r1   r*  r   r  r%   s        r'   rO   Uniform._iccdf_formulaG  r,  r)   c                .    [         R                  " U5      $ r    )r5   r6   )r1   r  r%   s      r'   rU   Uniform._entropy_formulaJ  s    vvbzr)   c                    USU-  -   $ Nr   r.   r  s        r'   rk   Uniform._mode_formulaM      3r6zr)   c                    USU-  -   $ r2  r.   r  s        r'   rg   Uniform._median_formulaP  r4  r)   c                 (    US-   nX6-  X&-  -
  Xd-  -  $ r  r.   )r1   rp   r   r   r  r%   np1s          r'   rq   Uniform._moment_raw_formulaS  s     aiCH--r)   c                 "    US:X  a  US-  S-  $ S $ )Nr      r.   )r1   rp   r  r%   s       r'   rx   Uniform._moment_central_formulaW  s     A:r1uRx/4/r)   r   c                 x     UR                  X4US9S   $ ! [         a    UR                  SSUS9U-  U-   s $ f = f)Nr   r.   r   r   )uniformOverflowError)r1   r   r   r   r   r  r%   s          r'   r   Uniform._sample_formula\  sM    	=;;q*;5b99 	=;;q!*;5b81<<	=s    !99r.   )NNN)%r   r   r   r   r   r   r   r   r  r   r	   r  r  r   r  r
   r   r   r0   r   r4   r:   r=   r@   rC   rF   rI   rO   rU   rk   rg   rq   rx   r   r   r   r   r   s   @r'   r   r     s    	 #s4Ic
3I|LJc)[IHc)ZHHc*jIH)  84+Hh?@I D - -
:3...0 '(S"= =r)   r   c                   r    \ rS rSr\" S\4S9r\" S\4SS9r\" S\SS9r	\" S	\SS9r
\" \	5      /r\
rS
 rSrg)_Gammaic  r   r   FFr   r   )r   
   r   r   c                n    XS-
  -  [         R                  " U* 5      -  [        R                  " U5      -  $ r  )r5   r   r   gamma)r1   r   r   r%   s       r'   r:   _Gamma._pdf_formulan  s+    U|bffaRj(7==+;;;r)   r.   N)r   r   r   r   r   r   r   r   r	   r  r   r
   r   r   r:   r   r.   r)   r'   rB  rB  c  sT    C1I!S^LJc)YGHc*iHH+H56I<r)   rB  c                      ^  \ rS rSrSr\" S\4SS9r\" SSS9r	\" SSS9r
\" S	\S
S9r\" S\	SS9r\" S\
SS9r\" \\5      /r\rU 4S jrS rS rS rS rS rS rS rS rSS/\l        S r/ SQ\l        SrU =r$ )r   ir  zBinomial distribution with prescribed success probability and number of trials

The probability density function of the binomial distribution is:

.. math::

    f(x) = {n \choose x} p^x (1 - p)^{n-x}

r   rC  r   )r   r   )r   nr   rI  )rD     r   r*  )g      ?g      ?r   )r   rD  c                *   > [         TU ]  " SXS.UD6  g )N)rI  r*  r.   r/   )r1   rI  r*  r%   r&   s       r'   r0   Binomial.__init__  r  r)   c                B    [         R                  R                  XU5      $ r    )r   _ufuncs
_binom_pmfr1   r   rI  r*  r%   s        r'   _pmf_formulaBinomial._pmf_formula      ))!22r)   c                   [         R                  " US-   5      [         R                  " US-   5      [         R                  " X!-
  S-   5      -   -
  nU[         R                  " X5      -   [         R                  " X!-
  U* 5      -   $ r  )r   gammalnxlogyxlog1py)r1   r   rI  r*  r%   combilns         r'   _logpmf_formulaBinomial._logpmf_formula  si    
 OOAaC GOOAaC$87??13q5;Q$QR 	 q,,wqsQB/GGGr)   c                B    [         R                  R                  XU5      $ r    )r   rN  
_binom_cdfrP  s        r'   r@   Binomial._cdf_formula  rS  r)   c                B    [         R                  R                  XU5      $ r    )r   rN  	_binom_sfrP  s        r'   rF   Binomial._ccdf_formula  s    ((q11r)   c                B    [         R                  R                  XU5      $ r    )r   rN  
_binom_ppfrP  s        r'   rI   Binomial._icdf_formula  rS  r)   c                B    [         R                  R                  XU5      $ r    )r   rN  
_binom_isfrP  s        r'   rO   Binomial._iccdf_formula  rS  r)   c                    [         R                  " US-   U-  5      n[         R                  " US:H  US-
  U5      nUS   $ )Nr   r.   )r5   floorr  )r1   rI  r*  r%   modes        r'   rk   Binomial._mode_formula  s;    xx1a xxQq$/Bxr)   c                B    US:X  a  X#-  $ US:X  a  X#-  SU-
  X#-  -   -  $ g r   r.   r1   rp   rI  r*  r%   s        r'   rq   Binomial._moment_raw_formula  s1    A:3JA:3A$$r)   r   r   c                    US:X  a  [         R                  " U5      $ US:X  a
  X#-  SU-
  -  $ US:X  a  X#-  SU-
  -  SSU-  -
  -  $ US:X  a  X#-  SU-
  -  SSU-  S-
  U-  SU-
  -  -   -  $ g )Nr   r   r   r      )r5   ru   rl  s        r'   rx    Binomial._moment_central_formula  s    A:==##A:3A;A:3A;AaC((A:3A;QqS1WaKQ$7 788r)   )r   r   r   r   r.   )r   r   r   r   r   r   r   	_n_domainr   	_p_domainr   r	   _n_param_p_paramr   r
   r   r   r0   rQ  rY  r@   rF   rI   rO   rk   rq   r   rx   r   r   r   s   @r'   r   r   r  s     !As8~NI.II!HMJc)XFHc)\JHc*gFH+Hh?@I-3H3233 #$Q
 &2""r)   r   )sysnumpyr5   r   scipyr   (scipy.stats._distribution_infrastructurer   r   r   r   r	   r
   r   __all__r   r   r#   r   r   rB  r   modulesr   __dict___module	dist_namer   r.   r)   r'   <module>r~     s    
   6 6 6 ,hD# hDV>K/V K/^?( ?DR=$ R=j<# <J2# J2` ++h

(
(I!.wy/A!BGI r)   