create_new_spend_data#

pymc_marketing.mmm.utils.create_new_spend_data(spend, adstock_max_lag, one_time, spend_leading_up=None)[source]#

Create new spend data for the channel forward pass.

Spends must be the same length as the number of channels.

(Source code, png, hires.png, pdf)

../../_images/pymc_marketing-mmm-utils-create_new_spend_data-1.png
Parameters:
spendnp.ndarray

The spend data for the channels.

adstock_max_lagint

The maximum lag for the adstock transformation.

one_time: bool, optional

If the spend is one-time, by default True.

spend_leading_upnp.ndarray, optional

The spend leading up to the first observation, by default None or 0.

Returns:
np.ndarray

The new spend data for the channel forward pass.