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

Add docstring for `HalfCauchyRV`

上级 63c9f2e6
......@@ -1036,6 +1036,18 @@ cauchy = CauchyRV()
class HalfCauchyRV(ScipyRandomVariable):
r"""A half-Cauchy continuous random variable.
The probability density function for `halfcauchy` 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)}
for :math:`x \geq 0` where :math:`\gamma > 0`.
"""
name = "halfcauchy"
ndim_supp = 0
ndims_params = [0, 0]
......@@ -1043,6 +1055,21 @@ class HalfCauchyRV(ScipyRandomVariable):
_print_name = ("C**+", "\\operatorname{C^{+}}")
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a half-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
......
......@@ -73,6 +73,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.HalfCauchyRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.HalfNormalRV
:members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论