
    Vpf                     ~    d dl 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
f
dZddeded	ed
ede
f
dZdS )    N)lax)_const)promote_args_inexact)Array	ArrayLike   xdflocscalereturnc                    t          d| |||          \  } }}}t          | d          }t          j        t          j        | |          |          }t          j        ||          }t          j        |t          | d                    }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        |                                        S )a  Student's T log probability distribution function.

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

  The Student's T probability distribution function is given by

  .. math::

     f(x, \nu) = \frac{\Gamma((\nu + 1)/2)}{\sqrt{\pi\nu}\Gamma(\nu/2)}(1 + x^2/\nu)^{(\nu+1)/2}

  Where :math:`\Gamma` is the :func:`~jax.scipy.special.gamma` function, and :math:`\nu > 0`
  is the degrees of freedom (JAX follows the scipy convention of naming this ``df``).

  Args:
    x: arraylike, value at which to evaluate the PDF
    df: 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.t.pdf`
  zt.logpdf   g      ?)r   
_lax_constr   divsubaddmulnppiloglgammaneglog1p)r	   r
   r   r   twoscaled_xdf_over_twodf_plus_one_over_twonormalize_term_constnormalize_term_tmpnormalize_term	quadratics               V/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/_src/scipy/stats/t.pylogpdfr$      sU   4 +:q"c5II!Re1a#WSWQ__e,,(C  +jC.@.@AA!6!6
1be8L8LMMwswsw/CR'H'HII3OO7373:k#:#:<NOO:&:;;= =.gcgh11266)	1EsyQZG[G[)\)\]]	^	^^    c                 J    t          j        t          | |||                    S )a  Student's T probability distribution function.

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

  The Student's T probability distribution function is given by

  .. math::

     f(x, \nu) = \frac{\Gamma((\nu + 1)/2)}{\sqrt{\pi\nu}\Gamma(\nu/2)}(1 + x^2/\nu)^{(\nu+1)/2}

  Where :math:`\Gamma` is the :func:`~jax.scipy.special.gamma` function, and :math:`\nu > 0`
  is the degrees of freedom (JAX follows the scipy convention of naming this ``df``).

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

  Returns:
    array

  See Also:
    :func:`jax.scipy.stats.t.logpdf`
  )r   expr$   )r	   r
   r   r   s       r#   pdfr(   ?   s"    4 
2sE**	+	++r%   )r   r   )numpyr   jaxr   jax._src.lax.laxr   r   jax._src.numpy.utilr   jax._src.typingr   r   r$   r(    r%   r#   <module>r/      s               1 1 1 1 1 1 4 4 4 4 4 4 , , , , , , , ,$_ $_i $_Y $_Y $_9 $_UZ $_ $_ $_ $_N, ,9 ,) ,) ,	 ,RW , , , , , ,r%   