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

Add docstring for `WeibullRV`

上级 327c112e
...@@ -595,12 +595,39 @@ exponential = ExponentialRV() ...@@ -595,12 +595,39 @@ exponential = ExponentialRV()
class WeibullRV(RandomVariable): class WeibullRV(RandomVariable):
r"""A weibull continuous random variable.
The probability density function for `weibull` in terms of its shape parameter :math:`k` is :
.. math::
f(x; k) = k x^{k-1} e^{-x^k}
for :math:`x \geq 0` and :math:`k > 0`.
"""
name = "weibull" name = "weibull"
ndim_supp = 0 ndim_supp = 0
ndims_params = [0] ndims_params = [0]
dtype = "floatX" dtype = "floatX"
_print_name = ("Weibull", "\\operatorname{Weibull}") _print_name = ("Weibull", "\\operatorname{Weibull}")
def __call__(self, shape, size=None, **kwargs):
r"""Draw samples from a weibull distribution.
Parameters
----------
shape
The shape :math:`k` 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__(shape, size=size, **kwargs)
weibull = WeibullRV() weibull = WeibullRV()
......
...@@ -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.WeibullRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.LogisticRV .. autoclass:: aesara.tensor.random.basic.LogisticRV
:members: __call__ :members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论