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

Add docstring for `ExponentialRV`

上级 fcd1c4c5
...@@ -581,6 +581,17 @@ gumbel = GumbelRV() ...@@ -581,6 +581,17 @@ gumbel = GumbelRV()
class ExponentialRV(RandomVariable): class ExponentialRV(RandomVariable):
r"""An exponential continuous random variable.
The probability density function for `exponential` in terms of its scale parameter :math:`\beta` is:
.. math::
f(x; \beta) = \frac{\exp(-x / \beta)}{\beta}
for :math:`x \geq 0` and :math:`\beta > 0`.
"""
name = "exponential" name = "exponential"
ndim_supp = 0 ndim_supp = 0
ndims_params = [0] ndims_params = [0]
...@@ -588,6 +599,19 @@ class ExponentialRV(RandomVariable): ...@@ -588,6 +599,19 @@ class ExponentialRV(RandomVariable):
_print_name = ("Exp", "\\operatorname{Exp}") _print_name = ("Exp", "\\operatorname{Exp}")
def __call__(self, scale=1.0, size=None, **kwargs): def __call__(self, scale=1.0, size=None, **kwargs):
r"""Draw samples from an exponential distribution.
Parameters
----------
scale
The scale :math:`\beta` 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__(scale, size=size, **kwargs) return super().__call__(scale, size=size, **kwargs)
......
...@@ -70,6 +70,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe ...@@ -70,6 +70,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe
.. autoclass:: aesara.tensor.random.basic.GumbelRV .. autoclass:: aesara.tensor.random.basic.GumbelRV
:members: __call__ :members: __call__
.. autoclass:: aesara.tensor.random.basic.ExponentialRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.WeibullRV .. autoclass:: aesara.tensor.random.basic.WeibullRV
:members: __call__ :members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论