one obvious error in the code is
df = pd.DataFrame.from_dict(data={‘x1’: x1, ‘x2’: x2, ‘response’: response, ‘date’: data[‘date’]})
x1 and x2 is already adstocked and saturated here…
should be:
df = pd.DataFrame.from_dict(data={‘x1’: data[‘x1’], ‘x2’: data[‘x2’], ‘response’: response, ‘date’: data[‘date’]})
will update how it effects the runtime… considering the mismatch of the data-generation-process and the model it may improve it a little bit.