LogLinkSpec#
- class pymc_marketing.mmm.link.LogLinkSpec[source]#
Log link:
median(y) = exp(mu) * target_scale.The likelihood is
LogNormal(mu, sigma), soexp(mu)is the conditional median of the response, not its mean (E[y] = exp(mu + sigma**2 / 2) * target_scale). All predictions and counterfactual contributions are computed on this median scale; use thecentral_tendency="mean"option (which appliesmean_correction(), theexp(sigma**2 / 2)factor) to obtain mean-scale quantities.Methods
LogLinkSpec.__init__(*args, **kwargs)Register counterfactual
total_media_contribution_original_scaleand{output_var}_original_scale.Return
Normal(0, 5)intercept prior (wider for log-scale).Return
LogNormallikelihood prior.Return
exp(mu)(the conditional median of the LogNormal response).LogLinkSpec.mean_correction(posterior[, ...])Return
exp(sigma**2 / 2), the LogNormal mean/median ratio.Return
exp(variable) * target_scale.Raise if likelihood is incompatible with link.
Raise
ValueErrorif y contains non-positive values.Attributes
link