Skip to content

Commit 0462b90

Browse files
committed
closes #576
1 parent 3f47233 commit 0462b90

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

pymc_extras/prior.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,9 +1474,33 @@ def create_likelihood_variable(
14741474

14751475

14761476
class Scaled:
1477-
"""Scaled distribution for numerical stability."""
1477+
"""Scaled distribution for numerical stability.
14781478
1479-
def __init__(self, dist: Prior, factor: float | pt.TensorVariable) -> None:
1479+
This is the same as multiplying the variable by a constant factor.
1480+
1481+
Parameters
1482+
----------
1483+
dist : Prior
1484+
The prior distribution to scale.
1485+
factor : pt.TensorLike
1486+
The scaling factor. This will have to be broadcastable to the
1487+
dimensions of the distribution.
1488+
1489+
Examples
1490+
--------
1491+
Create a scaled normal distribution.
1492+
1493+
.. code-block:: python
1494+
1495+
from pymc_extras.prior import Prior, Scaled
1496+
1497+
normal = Prior("Normal", mu=0, sigma=1)
1498+
# Same as Normal(mu=0, sigma=10)
1499+
scaled_normal = Scaled(normal, factor=10)
1500+
1501+
"""
1502+
1503+
def __init__(self, dist: Prior, factor: pt.TensorLike) -> None:
14801504
self.dist = dist
14811505
self.factor = factor
14821506

0 commit comments

Comments
 (0)