meridian.model.adstock_hill.compute_decay_weights

Computes decay weights using geometric and/or binomial decay.

This function always broadcasts the lag dimension (l_range) to the trailing axis of the output tensor.

alpha The parameter for the adstock decay function.
l_range A 1D tensor representing the lag range, e.g., [w-1, w-2, ..., 0].
window_size The number of time periods that go into the adstock weighted average for each output time period.
decay_functions String or sequence of strings indicating the decay function(s) to use for the Adstock calculation. Allowed values are 'geometric' and 'binomial'.
normalize A boolean indicating whether to normalize the weights. Default: True.

A tensor of weights with a shape of (*alpha.shape, len(l_range)).

ValueError If the shape of decay_functions is not broadcastable to the shape of alpha.