Skip to content

Commit

Permalink
Add docstring for WeibullRV
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf authored and brandonwillard committed Aug 4, 2022
1 parent 327c112 commit fcd1c4c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions aesara/tensor/random/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,39 @@ def __call__(self, scale=1.0, size=None, **kwargs):


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"
ndim_supp = 0
ndims_params = [0]
dtype = "floatX"
_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()

Expand Down
3 changes: 3 additions & 0 deletions doc/library/tensor/random/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.WeibullRV
:members: __call__

.. autoclass:: aesara.tensor.random.basic.LogisticRV
:members: __call__

Expand Down

0 comments on commit fcd1c4c

Please sign in to comment.