LogLinkSpec#

class pymc_marketing.mmm.link.LogLinkSpec[source]#

Log link: E[y] = exp(mu) * target_scale.

When used with LogSaturation, the model becomes a log-log specification where coefficients have an elasticity-like interpretation. Note that under the default scaling pipeline (y_scaled = y / target_scale), the intercept absorbs log(target_scale) and channel data is divided by channel_scale, so the beta coefficients are approximate elasticities with respect to scaled spend rather than strict textbook elasticities with respect to raw spend.

Methods

LogLinkSpec.__init__(*args, **kwargs)

LogLinkSpec.create_media_contribution_deterministic(...)

Register counterfactual total_media_contribution_original_scale and {output_var}_original_scale.

LogLinkSpec.default_intercept(dims)

Return Normal(0, 5) intercept prior (wider for log-scale).

LogLinkSpec.default_likelihood(dims)

Return LogNormal likelihood prior.

LogLinkSpec.inverse_link(mu)

Return exp(mu).

LogLinkSpec.original_scale_transform(...)

Return exp(variable) * target_scale.

LogLinkSpec.validate_likelihood_compatibility(...)

Raise if likelihood is incompatible with link.

LogLinkSpec.validate_target(y)

Raise ValueError if y contains non-positive values.

Attributes

link