
    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 d dlmZmZ 	 ddeded	ed
ededefdZ	 ddeded	ed
ededefdZdS )    )laxN)_const)promote_args_inexact)betaln)Array	ArrayLikeknablocreturnc                    t          d| ||||          \  } }}}}t          j        t          j        |           |          }t	          |d          }t	          |d          }t          j        t          j        t          j        |          t          t          j        t          j        ||          |          t          j        ||                                        }t          j        t          t          j        ||          t          j        t          j        ||          |                    t          ||                    }	t          j        ||	          }
t          j
        t          j        |t          j        |                    t          j        |t          j        ||                              }t          j        |t          j         |
          }
t          j
        t          j
        t          j        ||          t          j        ||                    t          j        ||                    }t          j        |t          j        |
          S )a
  Beta-binomial log probability mass function.

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

  The beta-binomial distribution's probability mass function is defined as

  .. math::

     f(k, n, a, b) = {n \choose k}\frac{B(k+a,n-k-b)}{B(a,b)}

  where :math:`B(a, b)` is the :func:`~jax.scipy.special.beta` function. It is
  defined for :math:`n\ge 0`, :math:`a>0`, :math:`b>0`, and non-negative integers `k`.

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

  Returns:
    array of logpmf values

  See Also:
    :func:`jax.scipy.stats.betabinom.pmf`
  zbetabinom.logpmf   r   )r   r   subfloor
_lax_constnegaddlog1pr   jnp
logical_orltgtwhereinfnan)r	   r
   r   r   r   yonezerocombilnbeta_lns	log_probsy_cond
n_a_b_conds                ^/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/_src/scipy/stats/betabinom.pylogpmfr'      s   8 ));Q1aMM/!Q1c	gcillC  !1a#	Aq		$GCGCIaLL&1s1K1KSWUVWZ^^*\*\]]^^'WVCGAaLL#'#'!A,,q*A*ABBF1QKKPP(ggx(()>#&CGCLL1136!SWQ__3M3MNN&i)44)~cnSVAs^^SVAt__MMsvVWY]__*	:sw		2	22    c           	      L    t          j        t          | ||||                    S )a  Beta-binomial probability mass function.

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

  The beta-binomial distribution's probability mass function is defined as

  .. math::

     f(k, n, a, b) = {n \choose k}\frac{B(k+a,n-k-b)}{B(a,b)}

  where :math:`B(a, b)` is the :func:`~jax.scipy.special.beta` function. It is
  defined for :math:`n\ge 0`, :math:`a>0`, :math:`b>0`, and non-negative integers `k`.

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

  Returns:
    array of pmf values

  See Also:
    :func:`jax.scipy.stats.betabinom.logpmf`
  )r   expr'   )r	   r
   r   r   r   s        r&   pmfr+   @   s$    8 
1aC((	)	))r(   )r   )jaxr   	jax.numpynumpyr   jax._src.lax.laxr   r   jax._src.numpy.utilr   jax._src.scipy.specialr   jax._src.typingr   r   r'   r+    r(   r&   <module>r4      s               1 1 1 1 1 1 4 4 4 4 4 4 ) ) ) ) ) ) , , , , , , , , &3 &3i &3I &3) &3	 &3&3"'&3 &3 &3 &3T * *9 * *y *Y **$* * * * * *r(   