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

Add docstring for `LogisticRV`

上级 275e12b5
...@@ -606,6 +606,18 @@ weibull = WeibullRV() ...@@ -606,6 +606,18 @@ weibull = WeibullRV()
class LogisticRV(RandomVariable): class LogisticRV(RandomVariable):
r"""A logistic continuous random variable.
The probability density function for `logistic` in terms of its location parameter :math:`\mu` and
scale parameter :math:`s` is :
.. math::
f(x; \mu, s) = \frac{e^{-(x-\mu)/s}}{s(1+e^{-(x-\mu)/s})^2}
for :math:`s > 0`.
"""
name = "logistic" name = "logistic"
ndim_supp = 0 ndim_supp = 0
ndims_params = [0, 0] ndims_params = [0, 0]
...@@ -613,6 +625,21 @@ class LogisticRV(RandomVariable): ...@@ -613,6 +625,21 @@ class LogisticRV(RandomVariable):
_print_name = ("Logistic", "\\operatorname{Logistic}") _print_name = ("Logistic", "\\operatorname{Logistic}")
def __call__(self, loc=0, scale=1, size=None, **kwargs): def __call__(self, loc=0, scale=1, size=None, **kwargs):
r"""Draw samples from a logistic distribution.
Parameters
----------
loc
The location parameter :math:`\mu` of the distribution.
scale
The scale :math:`s` 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)
......
...@@ -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.LogisticRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.VonMisesRV .. autoclass:: aesara.tensor.random.basic.VonMisesRV
:members: __call__ :members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论