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

Add docstring for `CauchyRV`

上级 2c9f692a
......@@ -991,6 +991,18 @@ hypergeometric = HyperGeometricRV()
class CauchyRV(ScipyRandomVariable):
r"""A Cauchy continuous random variable.
The probability density function for `cauchy` in terms of its location
parameter :math:`x_0` and scale parameter :math:`\gamma` is:
.. math::
f(x; x_0, \gamma) = \frac{1}{\pi \gamma \left(1 + (\frac{x-x_0}{\gamma})^2\right)}
where :math:`\gamma > 0`.
"""
name = "cauchy"
ndim_supp = 0
ndims_params = [0, 0]
......@@ -998,6 +1010,21 @@ class CauchyRV(ScipyRandomVariable):
_print_name = ("C", "\\operatorname{C}")
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a Cauchy distribution.
Parameters
----------
loc
Location parameter :math:`x_0` of the distribution.
scale
Scale parameter :math:`\gamma` 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)
@classmethod
......
......@@ -52,6 +52,9 @@ Aesara can produce :class:`RandomVariable`\s that draw samples from many differe
.. autoclass:: aesara.tensor.random.basic.BetaRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.CauchyRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.ChiSquareRV
:members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论