Skip to content

Commit b9b9ea1

Browse files
committed
Addressed review comments
1 parent 8a6b9b3 commit b9b9ea1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/source/Probability_Distributions.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ An exponential survival function, where :math:`c=0` denotes failure (or non-surv
5858
f(c, t) = \left\{ \begin{array}{l} \exp(-\lambda t), \text{if c=1} \\
5959
\lambda \exp(-\lambda t), \text{if c=0} \end{array} \right.
6060
61-
Such a function can be implemented as a PyMC distribution by writing a function that specifies the log-probability, then passing that function as a keyword argument to the ``DensityDist`` function, which creates an instance of a PyMC3 distribution with the custom function as its log-probability.
61+
Such a function can be implemented as a PyMC distribution by writing a function that specifies the log-probability, then passing that function as a keyword argument to the ``DensityDist`` function, which creates an instance of a PyMC distribution with the custom function as its log-probability.
6262

6363
For the exponential survival function, this is:
6464

6565
::
6666

67-
def logp(value, t, λ):
68-
return (value * log(λ) - λ * t).sum()
67+
def logp(value, t, lam):
68+
return (value * log(lam) - lam * t).sum()
6969

70-
exp_surv = pm.DensityDist('exp_surv', t, λ, logp=logp, observed=failure)
70+
exp_surv = pm.DensityDist('exp_surv', t, lam, logp=logp, observed=failure)
7171

7272
Similarly, if a random number generator is required, a function returning random numbers corresponding to the probability distribution can be passed as the ``random`` argument.
7373

pymc/distributions/distribution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def __new__(
434434
name : str
435435
dist_params : Tuple
436436
A sequence of the distribution's parameter. These will be converted into
437-
aesara tensors internally. These parameters could be other ``RandomVariable``
437+
Aesara tensors internally. These parameters could be other ``RandomVariable``
438438
instances.
439439
logp : Optional[Callable]
440440
A callable that calculates the log density of some given observed ``value``

pymc/tests/test_moment.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pymc.distributions.shape_utils import to_tuple
1111

1212

13-
@pytest.mark.parametrize("size", [None, (), (2,), (3, 2)], ids=str)
13+
@pytest.mark.parametrize("size", [(), (2,), (3, 2)], ids=str)
1414
def test_density_dist_moment_scalar(size):
1515
def moment(rv, size, mu):
1616
return (at.ones(size) * mu).astype(rv.dtype)
@@ -24,7 +24,7 @@ def moment(rv, size, mu):
2424
assert np.all(evaled_moment == mu_val)
2525

2626

27-
@pytest.mark.parametrize("size", [None, (), (2,), (3, 2)], ids=str)
27+
@pytest.mark.parametrize("size", [(), (2,), (3, 2)], ids=str)
2828
def test_density_dist_moment_multivariate(size):
2929
def moment(rv, size, mu):
3030
return (at.ones(size)[..., None] * mu).astype(rv.dtype)

0 commit comments

Comments
 (0)