Skip to content

Commit 4ec8a29

Browse files
committed
Add docstrings to Kumaraswamy distribution
1 parent 4421036 commit 4ec8a29

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pymc3/distributions/continuous.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,13 +955,42 @@ def _random(self, a, b, size=None):
955955
return (1 - (1 - u) ** (1 / b)) ** (1 / a)
956956

957957
def random(self, point=None, size=None):
958+
"""
959+
Draw random values from Kumaraswamy distribution.
960+
961+
Parameters
962+
----------
963+
point : dict, optional
964+
Dict of variable values on which random values are to be
965+
conditioned (uses default point if not specified).
966+
size : int, optional
967+
Desired size of random sample (returns one sample if not
968+
specified).
969+
970+
Returns
971+
-------
972+
array
973+
"""
958974
a, b = draw_values([self.a, self.b],
959975
point=point, size=size)
960976
return generate_samples(self._random, a, b,
961977
dist_shape=self.shape,
962978
size=size)
963979

964980
def logp(self, value):
981+
"""
982+
Calculate log-probability of Kumaraswamy distribution at specified value.
983+
984+
Parameters
985+
----------
986+
value : numeric
987+
Value(s) for which log-probability is calculated. If the log probabilities for multiple
988+
values are desired the values must be provided in a numpy array or theano tensor
989+
990+
Returns
991+
-------
992+
TensorVariable
993+
"""
965994
a = self.a
966995
b = self.b
967996

0 commit comments

Comments
 (0)