§
    Vp«f-  ã                   ó  — d dl mZ d dlmZ d dlmZ d dlm	Z	 d dl
mZmZ d dlmZmZmZmZ dded	ed
ededef
d„Zdded	ed
ededef
d„Zdded	ed
ededef
d„Zdded	ed
ededef
d„Zdded	ed
ededef
d„Zdded	ed
ededef
d„ZdS )é    )ÚlaxN)Ú_const)Úpromote_args_inexact)ÚArrayÚ	ArrayLike)ÚgammalnÚxlogyÚgammaincÚ	gammainccé   ÚxÚaÚlocÚscaleÚreturnc                 ó  — t          d| |||¦  «        \  } }}}t          | d¦  «        }t          j        t          j        | |¦  «        |¦  «        }t          j        t          t          j        ||¦  «        |¦  «        |¦  «        }t          j        t          |¦  «        t          j        |¦  «        ¦  «        }t          j        ||¦  «        }t          j
        t          j        | |¦  «        t          j         |¦  «        S )a4  Gamma log probability distribution function.

  JAX implementation of :obj:`scipy.stats.gamma` ``logpdf``.

  The Gamma probability distribution is given by

  .. math::

     f(x, a) = \frac{1}{\Gamma(a)}x^{a-1}e^{-x}

  Where :math:`\Gamma(a)` is the :func:`~jax.scipy.special.gamma` function.
  It is defined for :math:`x \ge 0` and :math:`a > 0`.

  Args:
    x: arraylike, value at which to evaluate the PDF
    a: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter
    scale: arraylike, distribution scale parameter

  Returns:
    array of logpdf values.

  See Also:
    - :func:`jax.scipy.stats.gamma.cdf`
    - :func:`jax.scipy.stats.gamma.pdf`
    - :func:`jax.scipy.stats.gamma.sf`
    - :func:`jax.scipy.stats.gamma.logcdf`
    - :func:`jax.scipy.stats.gamma.logsf`
  zgamma.logpdfr   )r   Ú
_lax_constr   ÚdivÚsubr	   Úaddr   ÚlogÚjnpÚwhereÚltÚinf)	r   r   r   r   ÚoneÚyÚlog_linear_termÚshape_termsÚ	log_probss	            úZ/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/_src/scipy/stats/gamma.pyÚlogpdfr"      sÃ   € õ< *¨.¸!¸QÀÀUÑKÔKÑ€!€QˆˆUÝ1aÑÔ€#Ý	„gcŒga˜‰oŒo˜uÑ%Ô%€!Ý”GE¥#¤'¨!¨S¡/¤/°1Ñ5Ô5°qÑ9Ô9€/Ý” ™
œ
¥C¤G¨E¡N¤NÑ3Ô3€+ÝŒgo {Ñ3Ô3€)Ý	Œ•3”6˜!˜S‘>”>¥C¤G 8¨YÑ	7Ô	7Ð7ó    c                 óJ   — t          j        t          | |||¦  «        ¦  «        S )a-  Gamma probability distribution function.

  JAX implementation of :obj:`scipy.stats.gamma` ``pdf``.

  The Gamma probability distribution is given by

  .. math::

     f(x, a) = \frac{1}{\Gamma(a)}x^{a-1}e^{-x}

  Where :math:`\Gamma(a)` is the :func:`~jax.scipy.special.gamma` function.
  It is defined for :math:`x \ge 0` and :math:`a > 0`.

  Args:
    x: arraylike, value at which to evaluate the PDF
    a: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter
    scale: arraylike, distribution scale parameter

  Returns:
    array of pdf values.

  See Also:
    - :func:`jax.scipy.stats.gamma.cdf`
    - :func:`jax.scipy.stats.gamma.sf`
    - :func:`jax.scipy.stats.gamma.logcdf`
    - :func:`jax.scipy.stats.gamma.logpdf`
    - :func:`jax.scipy.stats.gamma.logsf`
  )r   Úexpr"   ©r   r   r   r   s       r!   Úpdfr'   >   s"   € õ< 
Œ•˜˜1˜c 5Ñ)Ô)Ñ	*Ô	*Ð*r#   c                 ó  — t          d| |||¦  «        \  } }}}t          |t          j        t	          | d¦  «        t          j        t          j        | |¦  «        |¦  «        t	          | t          j        ¦  «        ¦  «        ¦  «        S )a  Gamma cumulative distribution function.

  JAX implementation of :obj:`scipy.stats.gamma` ``cdf``.

  The cdf is defined as

  .. math::

     f_{cdf}(x, a) = \int_{-\infty}^x f_{pdf}(y, a)\mathrm{d}y

  where :math:`f_{pdf}` is the probability density function,
  :func:`jax.scipy.stats.gamma.pdf`.

  Args:
    x: arraylike, value at which to evaluate the CDF
    a: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter
    scale: arraylike, distribution scale parameter

  Returns:
    array of cdf values.

  See Also:
    - :func:`jax.scipy.stats.gamma.pdf`
    - :func:`jax.scipy.stats.gamma.sf`
    - :func:`jax.scipy.stats.gamma.logcdf`
    - :func:`jax.scipy.stats.gamma.logpdf`
    - :func:`jax.scipy.stats.gamma.logsf`
  z	gamma.cdfr   )	r   r
   r   Úclampr   r   r   r   r   r&   s       r!   Úcdfr*   _   s{   € õ< *¨+°q¸!¸SÀ%ÑHÔHÑ€!€QˆˆUÝ	ØÝ„IÝAÑÔÝ	„gcŒga˜‰oŒo˜uÑ%Ô%Ý•C”GÑÔñô ñ
ô 
ð r#   c                 óJ   — t          j        t          | |||¦  «        ¦  «        S )a  Gamma log cumulative distribution function.

  JAX implementation of :obj:`scipy.stats.gamma` ``logcdf``.

  The cdf is defined as

  .. math::

     f_{cdf}(x, a) = \int_{-\infty}^x f_{pdf}(y, a)\mathrm{d}y

  where :math:`f_{pdf}` is the probability density function,
  :func:`jax.scipy.stats.gamma.pdf`.

  Args:
    x: arraylike, value at which to evaluate the CDF
    a: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter
    scale: arraylike, distribution scale parameter

  Returns:
    array of logcdf values.

  See Also:
    - :func:`jax.scipy.stats.gamma.cdf`
    - :func:`jax.scipy.stats.gamma.pdf`
    - :func:`jax.scipy.stats.gamma.sf`
    - :func:`jax.scipy.stats.gamma.logpdf`
    - :func:`jax.scipy.stats.gamma.logsf`
  )r   r   r*   r&   s       r!   Úlogcdfr,   ˆ   s"   € õ< 
Œ•Q˜˜3 Ñ&Ô&Ñ	'Ô	'Ð'r#   c           	      óž   — t          d| |||¦  «        \  } }}}t          |t          j        t          j        | |¦  «        |¦  «        ¦  «        S )aï  Gamma survival function.

  JAX implementation of :obj:`scipy.stats.gamma` ``sf``.

  The survival function is defined as

  .. math::

     f_{sf}(x, k) = 1 - f_{cdf}(x, k)

  where :math:`f_{cdf}(x, k)` is the cumulative distribution function,
  :func:`jax.scipy.stats.gamma.cdf`.

  Args:
    x: arraylike, value at which to evaluate the SF
    a: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter
    scale: arraylike, distribution scale parameter

  Returns:
    array of sf values.

  See Also:
    - :func:`jax.scipy.stats.gamma.cdf`
    - :func:`jax.scipy.stats.gamma.pdf`
    - :func:`jax.scipy.stats.gamma.logcdf`
    - :func:`jax.scipy.stats.gamma.logpdf`
    - :func:`jax.scipy.stats.gamma.logsf`
  zgamma.sf)r   r   r   r   r   r&   s       r!   Úsfr.   ©   sH   € õ< *¨*°a¸¸CÀÑGÔGÑ€!€QˆˆUÝ	1•c”gcœg a¨™oœo¨uÑ5Ô5Ñ	6Ô	6Ð6r#   c                 óJ   — t          j        t          | |||¦  «        ¦  «        S )aö  Gamma log survival function.

  JAX implementation of :obj:`scipy.stats.gamma` ``logsf``.

  The survival function is defined as

  .. math::

     f_{sf}(x, k) = 1 - f_{cdf}(x, k)

  where :math:`f_{cdf}(x, k)` is the cumulative distribution function,
  :func:`jax.scipy.stats.gamma.cdf`.

  Args:
    x: arraylike, value at which to evaluate the SF
    a: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter
    scale: arraylike, distribution scale parameter

  Returns:
    array of logsf values.

  See Also:
    - :func:`jax.scipy.stats.gamma.cdf`
    - :func:`jax.scipy.stats.gamma.pdf`
    - :func:`jax.scipy.stats.gamma.sf`
    - :func:`jax.scipy.stats.gamma.logcdf`
    - :func:`jax.scipy.stats.gamma.logpdf`
  )r   r   r.   r&   s       r!   Úlogsfr0   Ë   s"   € õ< 
Œ•Aq˜#˜uÑ%Ô%Ñ	&Ô	&Ð&r#   )r   r   )Újaxr   Ú	jax.numpyÚnumpyr   Újax._src.lax.laxr   r   Újax._src.numpy.utilr   Újax._src.typingr   r   Újax.scipy.specialr   r	   r
   r   r"   r'   r*   r,   r.   r0   © r#   r!   ú<module>r9      s  ðð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ Að$8ð $8ˆið $8˜Ið $8¨Ið $8À)ð $8ÐTYð $8ð $8ð $8ð $8ðN+ð +ˆ9ð +˜ð +¨ð +¸yð +ÐQVð +ð +ð +ð +ðB&ð &ˆ9ð &˜ð &¨ð &¸yð &ÐQVð &ð &ð &ð &ðR(ð (ˆið (˜Ið (¨Ið (À)ð (ÐTYð (ð (ð (ð (ðB7ð 7ˆ)ð 7˜	ð 7¨	ð 7¸ið 7ÐPUð 7ð 7ð 7ð 7ðD'ð 'ˆYð '˜9ð '¨9ð 'Àð 'ÐSXð 'ð 'ð 'ð 'ð 'ð 'r#   