add_noise_to_channel_allocation#
- pymc_marketing.mmm.utils.add_noise_to_channel_allocation(df, channels, rel_std=0.05, seed=None)[source]#
Return df with additive Gaussian noise applied to channels columns.
- Parameters:
- df
DataFrame The original data (will not be modified in-place).
- channels
listofstr Column names whose values represent media spends.
- rel_std
float, default 0.05 Noise standard-deviation expressed as a fraction of the column mean (i.e.
0.05⇒ 5 % of the mean spend).- seed
intorNone Optional seed for deterministic output.
- df
- Returns:
DataFrameA copy of df with noisy spends.