提交 275e12b5 authored 作者: Rémi Louf's avatar Rémi Louf 提交者: Brandon T. Willard

Add docstring for `VonMissesRV`

上级 aaa7782c
......@@ -620,12 +620,43 @@ logistic = LogisticRV()
class VonMisesRV(RandomVariable):
r"""A von Misses continuous random variable.
The probability density function for `vonmisses` in terms of its mode :math:`\mu` and
dispersion parameter :math:`\kappa` is :
.. math::
f(x; \mu, \kappa) = \frac{e^{\kappa \cos(x-\mu)}}{2 \pi I_0(\kappa)}
for :math:`x \in [-\pi, \pi]` and :math:`\kappa > 0`. :math:`I_0` is the modified Bessel
function of order 0.
"""
name = "vonmises"
ndim_supp = 0
ndims_params = [0, 0]
dtype = "floatX"
_print_name = ("VonMises", "\\operatorname{VonMises}")
def __call__(self, mu, kappa, size=None, **kwargs):
r"""Draw samples from a von Mises distribution.
Parameters
----------
mu
The mode :math:`\mu` of the distribution.
kappa
The dispersion parameter :math:`\kappa` of the distribution. Must be positive.
size
Sample shape. If the given size is, e.g. `(m, n, k)` then `m * n * k`
independent, identically distributed random variables are
returned. Default is `None` in which case a single random variable
is returned.
"""
return super().__call__(mu, kappa, size=size, **kwargs)
vonmises = VonMisesRV()
......
......@@ -70,6 +70,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe
.. autoclass:: aesara.tensor.random.basic.GumbelRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.VonMisesRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.NormalRV
:members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论