exponential decay - alpha as tuning-parameter by group

Hi,

I am looking for a solution with the recipe package for the following problem.

I aim for a marketingmix modell (mmm). It includes media spend for different campaigns (products) over time (even in parallel).

In the domain of mmm it is proposed to work with an ad-stock instead of the media spend. The rationale is, that advertising has an effect even, when it is no longer on air. For this I use an exponential decay with the parameter alpha. My idea is, to think of alpha as a tuning parameter.

But the problem is, that it should be calculated (with the same alpha over all campaigns), grouped by every campaign for itself.

Does anyone have an idea on how I can achieve this with the existing step-functions?

Looking forward to a tip/hint.

Best regards
Chris