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

Add docstring for `WaldRV`

上级 8636b600
......@@ -1096,6 +1096,18 @@ invgamma = InvGammaRV()
class WaldRV(RandomVariable):
r"""A Wald (or inverse Gaussian) continuous random variable.
The probability density function for `wald` in terms of its mean
parameter :math:`\mu` and shape parameter :math:`\lambda` is:
.. math::
f(x; \mu, \lambda) = \sqrt{\frac{\lambda}{2 \pi x^3}} \exp\left(-\frac{\lambda (x-\mu)^2}{2 \mu^2 x}\right)
for :math:`x > 0`, where :math:`\mu > 0` and :math:`\lambda > 0`.
"""
name = "wald"
ndim_supp = 0
ndims_params = [0, 0]
......@@ -1103,6 +1115,21 @@ class WaldRV(RandomVariable):
_print_name_ = ("Wald", "\\operatorname{Wald}")
def __call__(self, mean=1.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a Wald distribution.
Parameters
----------
mean
Mean parameter :math:`\mu` of the distribution. Must be positive.
shape
Shape parameter :math:`\lambda` of the distribution. Must be
positive.
size
Sample shape. If the given size is `(m, n, k)`, then `m * n * k`
independent, identically distributed samples are returned. Default is
`None`, in which case a single sample is returned.
"""
return super().__call__(mean, scale, size=size, **kwargs)
......
......@@ -109,5 +109,8 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe
.. autoclass:: aesara.tensor.random.basic.VonMisesRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.WaldRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.WeibullRV
:members: __call__
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论