LinkSpec#
- class pymc_marketing.mmm.link.LinkSpec[source]#
Strategy object that centralises all link-dependent behaviour.
Subclasses implement the five link-specific decisions:
inverse_link()– map the linear predictor to the response scale.default_likelihood()– default likelihood prior.default_intercept()– default intercept prior.validate_target()– fit-time target checks.create_media_contribution_deterministic()– graph fortotal_media_contribution_original_scale.
One concrete helper is shared by all links:
create_total_response_deterministic()(the mu-effect objectivetotal_response_original_scale, registered byMMM.build_modelonly when the model has mu effects).Methods
LinkSpec.__init__(*args, **kwargs)Register total media contribution deterministic nodes.
Register
total_response_original_scale.Return the default intercept prior for this link.
Return the default likelihood prior for this link.
Map the linear predictor mu to the response scale.
LinkSpec.mean_correction(posterior[, output_var])Per-draw factor converting median-scale outputs to the response mean.
LinkSpec.original_scale_transform(variable, ...)Transform a model variable to the original (response) scale.
Raise if likelihood is incompatible with link.
Validate that y is compatible with this link function.
Attributes
link