Skip to content

Commit ff7f047

Browse files
tblazinatwiecki
authored andcommitted
Improve distribution docs - continued (#3479)
* add doc strings for logp methods for time series distributions * Add docstring for transformed distribution logp method * Add docstring for random method for multivariate distributions * Add docstrings to logp method for multivariate distributions * change docstring paramter to match actual parameter name defined in function definition * Add docstrings to logp and random methods for bound distributions * Fix mismatched function parameters and docstring variable names * add docstring to logp_nojac method for transformed distribution * Add docstrings to all logcdf methods for continuous distributions * Fix accidently deletion of variable * Fix repeated typo
1 parent 2545d60 commit ff7f047

File tree

5 files changed

+661
-7
lines changed

5 files changed

+661
-7
lines changed

pymc3/distributions/bound.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ def __init__(self, distribution, lower, upper, default, *args, **kwargs):
4040
)
4141

4242
def logp(self, value):
43+
"""
44+
Calculate log-probability of Bounded distribution at specified value.
45+
46+
Parameters
47+
----------
48+
value : numeric
49+
Value for which log-probability is calculated.
50+
51+
Returns
52+
-------
53+
TensorVariable
54+
"""
4355
logp = self._wrapped.logp(value)
4456
bounds = []
4557
if self.lower is not None:
@@ -76,6 +88,22 @@ def _random(self, lower, upper, point=None, size=None):
7688
return samples[0]
7789

7890
def random(self, point=None, size=None):
91+
"""
92+
Draw random values from Bounded distribution.
93+
94+
Parameters
95+
----------
96+
point : dict, optional
97+
Dict of variable values on which random values are to be
98+
conditioned (uses default point if not specified).
99+
size : int, optional
100+
Desired size of random sample (returns one sample if not
101+
specified).
102+
103+
Returns
104+
-------
105+
array
106+
"""
79107
if self.lower is None and self.upper is None:
80108
return self._wrapped.random(point=point, size=size)
81109
elif self.lower is not None and self.upper is not None:

0 commit comments

Comments
 (0)