SpendProbe.assert_increment_is_complete#
- SpendProbe.assert_increment_is_complete(*, effects, non_date_dims)[source]#
Check the evaluated nodes account for the whole move in the predictor.
Everything downstream rests on one identity:
\[\Delta \mu_t = \sum_c \Delta v_{t,c} + \sum_j \Delta e_{t,j}\]– spend moves the linear predictor through
channel_contributionand the resolved effects, and through nothing else. Up to here that is an assumption, and three separate mistakes break it silently: an effect that reports the wrong contribution variable, an effect that cannot be attributed at all, and a model-level node that readschannel_dataoutside any effect. Each drops a real part of the increment and reports the remainder as if it were the whole.So it is checked rather than assumed, against the probe evaluation
measure()already paid for. A structural check – does spend reach \(\mu\) other than through the accounted nodes – would miss the misreporting case, because a variable upstream of the true contribution blocks the same paths while entering \(\mu\) through a nonlinearity that makes the sum above false.- Parameters:
- effectssequence of
ChannelDependentEffect The effects being evaluated alongside
channel_contribution.- non_date_dims
mapping Per node, the dimensions its evaluation carries after
sampleanddate. The terms are added by name: an effect may legitimately drop a dimension the predictor has, and a panel model’s predictor need not order the ones it keeps the way spend does.
- effectssequence of
- Raises:
NotImplementedErrorIf the accounted nodes do not reproduce the predictor’s move.