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

Add docstring for `LaplaceRV`

上级 de64d543
......@@ -1270,12 +1270,42 @@ bernoulli = BernoulliRV()
class LaplaceRV(RandomVariable):
r"""A Laplace continuous random variable.
The probability density function for `laplace` in terms of its location
parameter :math:`\mu` and scale parameter :math:`\lambda` is:
.. math::
f(x; \mu, \lambda) = \frac{1}{2 \lambda} \exp\left(-\frac{|x-\mu|}{\lambda}\right)
with :math:`\lambda > 0`.
"""
name = "laplace"
ndim_supp = 0
ndims_params = [0, 0]
dtype = "floatX"
_print_name = ("Laplace", "\\operatorname{Laplace}")
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a Laplace distribution.
Parameters
----------
loc
Location parameter :math:`\mu` of the distribution.
scale
Scale parameter :math:`\lambda` of the distribution. Must be
positive.
size
Sample shape. If the given size is `(m, n, k)`, then `m * n * k`
independent, identically distributed samples are returned. Default
is `None` in which case a single sample is returned.
"""
return super().__call__(loc, scale, size=size, **kwargs)
laplace = LaplaceRV()
......
......@@ -88,6 +88,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe
.. autoclass:: aesara.tensor.random.basic.InvGammaRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.LaplaceRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.LogisticRV
:members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论