
    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 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)gammalnxlogy)Array	ArrayLikeknplocreturnc           
         t          d| |||          \  } }}}t          | d          }t          j        | |          }t          j        t          j        t	          t          j        ||                    t	          |                    t	          t          j        ||                              }t          j        t          ||          t          |t          j        ||                              }t          j        ||          }t          j        t          j	        | |          t          j
         |          S )aI  Negative-binomial log probability mass function.

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

  The negative-binomial probability mass function is given by

  .. math::

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

  for :math:`k \ge 0` and :math:`0 \le p \le 1`.

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

  Returns:
    array of logpdf values.

  See Also:
    :func:`jax.scipy.stats.nbinom.pmf`
  znbinom.logpmf   )r   
_lax_constr   subr   addr   jnpwhereltinf)	r
   r   r   r   oney	comb_termlog_linear_term	log_probss	            [/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/_src/scipy/stats/nbinom.pylogpmfr      s    2 &oq!QDD,!Q31a#	gaoo!gGGCGAqMM""GAJJ//C1I1I ) GE!QKKq#'#q//)B)BCC/gi11)	36!S>>CG8Y	7	77    c                 J    t          j        t          | |||                    S )aB  Negative-binomial probability mass function.

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

  The negative-binomial probability mass function is given by

  .. math::

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

  for :math:`k \ge 0` and :math:`0 \le p \le 1`.

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

  Returns:
    array of pmf values.

  See Also:
    :func:`jax.scipy.stats.nbinom.logpmf`
  )r   expr   )r
   r   r   r   s       r   pmfr"   ;   s"    2 
1a%%	&	&&r   )r   )jaxr   	jax.numpynumpyr   jax._src.lax.laxr   r   jax._src.numpy.utilr   jax._src.scipy.specialr   r   jax._src.typingr   r	   r   r"    r   r   <module>r+      s               1 1 1 1 1 1 4 4 4 4 4 4 1 1 1 1 1 1 1 1 , , , , , , , ,!8 !8i !8I !8) !8) !8E !8 !8 !8 !8H' '9 ' 'y 'y ' ' ' ' ' ' 'r   