File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -1474,9 +1474,33 @@ def create_likelihood_variable(
14741474
14751475
14761476class 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
You can’t perform that action at this time.
0 commit comments