
    Vpf              	           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 ddeded	ed
efdZddeded	ed
efdZddeded	ed
efdZdS )    )laxN)_const)promote_args_inexact)Array	ArrayLike)xlogygammaln	gammaincckmulocreturnc           
         t          d| ||          \  } }}t          | d          }t          j        | |          }t	          ||          t          |dz             z
  |z
  }t          j        t          j        t          j	        ||          t          j
        t          j        |           |                     t          j         |          S )a7  Poisson log probability mass function.

  JAX implementation of :obj:`scipy.stats.poisson` ``logpmf``.

  The Poisson probability mass function is given by

  .. math::

     f(k) = e^{-\mu}\frac{\mu^k}{k!}

  and is defined for :math:`k \ge 0` and :math:`\mu \ge 0`.

  Args:
    k: arraylike, value at which to evaluate the PMF
    mu: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter

  Returns:
    array of logpmf values.

  See Also:
    - :func:`jax.scipy.stats.poisson.cdf`
    - :func:`jax.scipy.stats.poisson.pmf`
  poisson.logpmfr      )r   
_lax_constr   subr   r	   jnpwhere
logical_orltneroundinf)r   r   r   zerox	log_probss         \/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/_src/scipy/stats/poisson.pylogpmfr      s    2 $$4aSAA*!R	Aq		$	gaoo!ArllWQU^^+b0)	3>#&D//"%&1q"9"9; ;=@WHi
Q 
Q Q    c                 H    t          j        t          | ||                    S )a0  Poisson probability mass function.

  JAX implementation of :obj:`scipy.stats.poisson` ``pmf``.

  The Poisson probability mass function is given by

  .. math::

     f(k) = e^{-\mu}\frac{\mu^k}{k!}

  and is defined for :math:`k \ge 0` and :math:`\mu \ge 0`.

  Args:
    k: arraylike, value at which to evaluate the PMF
    mu: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter

  Returns:
    array of pmf values.

  See Also:
    - :func:`jax.scipy.stats.poisson.cdf`
    - :func:`jax.scipy.stats.poisson.logpmf`
  )r   expr   )r   r   r   s      r   pmfr#   8   s     2 
2s##	$	$$r    c                    t          d| ||          \  } }}t          | d          }t          j        | |          }t	          t          j        d|z             |          }t          j        t          j        ||          ||          S )an  Poisson cumulative distribution function.

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

  The cumulative distribution function is defined as:

  .. math::

     f_{cdf}(k, p) = \sum_{i=0}^k f_{pmf}(k, p)

  where :math:`f_{pmf}(k, p)` is the probability mass function
  :func:`jax.scipy.stats.poisson.pmf`.

  Args:
    k: arraylike, value at which to evaluate the CDF
    mu: arraylike, distribution shape parameter
    loc: arraylike, distribution offset parameter

  Returns:
    array of cdf values.

  See Also:
    - :func:`jax.scipy.stats.poisson.pmf`
    - :func:`jax.scipy.stats.poisson.logpmf`
  r   r   r   )	r   r   r   r   r
   r   floorr   r   )r   r   r   r   r   ps         r   cdfr'   T   sw    4 $$4aSAA*!R	Aq		$	gaoo!	!a%  "%%!	36!T??D!	,	,,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   <module>r0      s8               1 1 1 1 1 1 4 4 4 4 4 4 , , , , , , , , 7 7 7 7 7 7 7 7 7 7Q Qi QY QY Qu Q Q Q QB% %9 %) %) %E % % % %8- -9 -) -) -E - - - - - -r    