linear_predictor#
- pymc_marketing.mmm.spend_reach.linear_predictor(model)[source]#
Find the node the increment is assembled to reproduce.
Under a log link the MMM registers its linear predictor as the
Deterministicmu. Under an identity link the same quantity is an anonymous intermediate that only carries the namemu, so it has to be recovered from the graph of the observed variable.- Parameters:
- model
MMM The fitted model to search.
- model
- Returns:
VariableorNoneThe linear predictor, or
Noneif this model does not expose one – in which caseSpendProbe.assert_increment_is_complete()has nothing to check against and says so.
- Raises:
ValueErrorIf the graph carries more than one node named
mu, which leaves the predictor impossible to identify by name. Seefind_named_node()for the one collision that escapes the check: a user-registeredDeterministicnamedmuis found by thenamed_varslookup below before any graph search happens.