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

Add docstring for `GumbelRV`

上级 977458dc
...@@ -524,6 +524,18 @@ pareto = ParetoRV() ...@@ -524,6 +524,18 @@ pareto = ParetoRV()
class GumbelRV(ScipyRandomVariable): class GumbelRV(ScipyRandomVariable):
r"""A gumbel continuous random variable.
The probability density function for `gumbel` in terms of its location parameter :math:`\mu` and
scale parameter :math:`\beta` is:
.. math::
f(x; \mu, \beta) = \frac{\exp(-(x + e^{(x-\mu)/\beta})}{\beta}
for :math:`\beta > 0`.
"""
name = "gumbel" name = "gumbel"
ndim_supp = 0 ndim_supp = 0
ndims_params = [0, 0] ndims_params = [0, 0]
...@@ -537,6 +549,21 @@ class GumbelRV(ScipyRandomVariable): ...@@ -537,6 +549,21 @@ class GumbelRV(ScipyRandomVariable):
size: Optional[Union[List[int], int]] = None, size: Optional[Union[List[int], int]] = None,
**kwargs, **kwargs,
) -> RandomVariable: ) -> RandomVariable:
r"""Draw samples from a gumbel distribution.
Parameters
----------
loc
The location parameter :math:`\mu` of the distribution.
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__(loc, scale, size=size, **kwargs) return super().__call__(loc, scale, size=size, **kwargs)
@classmethod @classmethod
......
...@@ -67,6 +67,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe ...@@ -67,6 +67,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe
.. autoclass:: aesara.tensor.random.basic.ParetoRV .. autoclass:: aesara.tensor.random.basic.ParetoRV
:members: __call__ :members: __call__
.. autoclass:: aesara.tensor.random.basic.GumbelRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.NormalRV .. autoclass:: aesara.tensor.random.basic.NormalRV
:members: __call__ :members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论