
    uki                     |    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y)    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               Q/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/jax/_src/scipy/stats/t.pylogpdfr#      s7   4 +:q"c5I!Re1a#WWSWWQ_e,(C +jC.@A!6
1bee8LMwwswwsww/CR'HI3O773773::k#:<NO::&:;=.ggcggh126)	1EsyyQZG[)\]	^^    c                 D    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      )numpyr   jax._srcr   jax._src.lax.laxr   r   jax._src.numpy.utilr   jax._src.typingr   r   r#   r'    r$   r"   <module>r/      so       1 4 ,$_i $_Y $_Y $_9 $_UZ $_N,9 ,) ,) ,	 ,RW ,r$   