![]() |
Transforms a distribution with support on [0, infinity)
to (0, 1]
.
meridian.model.adstock_hill.transform_non_negative_reals_distribution(
distribution: backend.tfd.Distribution
) -> backend.tfd.TransformedDistribution
This allows for defining a prior on alpha_*
, the exponent of the binomial
Adstock decay function, directly, and then translating it to a distribution
defined on the unit interval as Meridian expects. This transformation
(x -> 1 / (1 + x))
is the inverse of the interval mapping the Meridian
performs (x -> 1 / x - 1)
on alpha to define the binomial Adstock
decay function's exponent.
For example, to define a LogNormal(0.2, 0.9)
prior on alpha_*
:
from meridian import backend
alpha_star_prior = backend.tfd.LogNormal(0.2, 0.9)
alpha_prior = transform_non_negative_reals_distribution(alpha_star_prior)
prior = prior_distribution.PriorDistribution(
alpha_m=alpha_prior,
...
)
Args | |
---|---|
distribution
|
A Tensorflow Probability distribution with support on [0,
infinity) .
|
Returns | |
---|---|
A Tensorflow Probability TransformedDistribution with support on (0, 1] ,
such that the resultant prior on alpha_* is the input distribution.
|