From 1cee9fd9f0c2c79564ddff3b317f302d40545eea Mon Sep 17 00:00:00 2001 From: Sagar Tomar Date: Sat, 19 Feb 2022 17:33:26 +0530 Subject: [PATCH 1/2] Updated docstrings for pymc.Beta --- pymc/distributions/continuous.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pymc/distributions/continuous.py b/pymc/distributions/continuous.py index a946b099a8..1e612ff8d6 100644 --- a/pymc/distributions/continuous.py +++ b/pymc/distributions/continuous.py @@ -1167,6 +1167,7 @@ class Beta(UnitContinuous): \frac{x^{\alpha - 1} (1 - x)^{\beta - 1}}{B(\alpha, \beta)} .. plot:: + :context: close-figs import matplotlib.pyplot as plt import numpy as np @@ -1204,14 +1205,14 @@ class Beta(UnitContinuous): Parameters ---------- - alpha: float - alpha > 0. - beta: float - beta > 0. - mu: float - Alternative mean (0 < mu < 1). - sigma: float - Alternative standard deviation (0 < sigma < sqrt(mu * (1 - mu))). + alpha : tensor_like of float + ``alpha`` > 0. + beta : tensor_like of float + ``beta`` > 0. + mu : tensor_like of float, optional + Alternative mean (0 < ``mu`` < 1). + sigma : tensor_like of float, optional + Alternative standard deviation (1 < ``sigma`` < sqrt(``mu`` * (1 - ``mu``))). Notes ----- @@ -1264,9 +1265,13 @@ def logcdf(value, alpha, beta): Parameters ---------- - value: numeric or np.ndarray or aesara.tensor + value : tensor_like of float Value(s) for which log CDF is calculated. If the log CDF for multiple values are desired the values must be provided in a numpy array or Aesara tensor. + alpha : tensor_like of float + ``alpha`` > 0. + beta : tensor_like of float + ``beta`` > 0. Returns ------- From 91ebd2543834e62933fae5de4415d4e18e527a9b Mon Sep 17 00:00:00 2001 From: Sagar Tomar Date: Thu, 24 Feb 2022 20:14:45 +0530 Subject: [PATCH 2/2] Marked alpha and beta as optional in pymc.Beta docstring --- pymc/distributions/continuous.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymc/distributions/continuous.py b/pymc/distributions/continuous.py index 1e612ff8d6..c6faca117b 100644 --- a/pymc/distributions/continuous.py +++ b/pymc/distributions/continuous.py @@ -1205,10 +1205,10 @@ class Beta(UnitContinuous): Parameters ---------- - alpha : tensor_like of float - ``alpha`` > 0. - beta : tensor_like of float - ``beta`` > 0. + alpha : tensor_like of float, optional + ``alpha`` > 0. If not specified, then calculated using ``mu`` and ``sigma``. + beta : tensor_like of float, optional + ``beta`` > 0. If not specified, then calculated using ``mu`` and ``sigma``. mu : tensor_like of float, optional Alternative mean (0 < ``mu`` < 1). sigma : tensor_like of float, optional