SpendReach#
- class pymc_marketing.mmm.spend_reach.SpendReach(effective_l_max, requires_full_axis, measured=<factory>, max_lag=None)[source]#
What the evaluation is allowed to assume about its window.
The whole contract between this module and
Incrementality: the window length, the evaluation mode and the longest lag, plus the per-node measurements they were derived from for anyone who wants to see the working.- Parameters:
- effective_l_max
int Evaluation-window half-length covering every path spend can take – the model’s own
adstock.l_maxplus the widest extra carryover measured. A mediated path that chains a second adstock outlives the direct one, and a window sized for the direct path alone would cut the tail off.- requires_full_axisbool
Whether every period has to be evaluated on the complete fitted date axis, because some node’s value depends on the whole series.
- measured
mapping Per evaluated node, its
TemporalReach. Empty when no probe was possible.- max_lag
intorNone, default=None The last lag, in data periods after the spend date, at which a change in spend moves any evaluated node. Not
effective_l_max - 1: the window is one date longer than a plain adstock’s kernel, which covers lags0 .. l_max - 1, while a mediated tail that outlives the direct path sizes the window to exactly its own last lag. Never less than the kernel’s own trailing lags (l_max - 1underConvMode.After,l_max // 2underOverlap, none underBefore; seekernel_trailing_lags()), so a plain adstock’s horizon is its kernel length and does not shift with how far the sampled weights stay aboveSpendProbe.REACH_TOLERANCE. Measured only: a declaration wider than the measurement widens the window, but the documented recipe declares a mediator’s ownl_max, which overstates the chained reach, so it does not move this.Noneexactly whenrequires_full_axis: no window bounds the reach, so there is no longest lag to report. Any other combination raisesValueError, so a windowed reach always carries a horizon.
- effective_l_max
Methods
SpendReach.__init__(effective_l_max, ...[, ...])Attributes