DelayedSaturatedMMM.plot_new_spend_contributions#

DelayedSaturatedMMM.plot_new_spend_contributions(spend_amount, one_time=True, lower=0.025, upper=0.975, ylabel='Sales', idx=None, channels=None, prior=False, original_scale=True, ax=None, **sample_posterior_predictive_kwargs)[source]#

Plot the upcoming sales for a given spend amount.

Calls the new_spend_contributions method and plots the results. For more control over the plot, use new_spend_contributions directly.

Parameters:
  • spend_amount (float) – The amount of spend for each channel

  • one_time (bool, optional) – Whether the spend are one time (at start of period) or constant (over period), by default True (one time)

  • lower (float, optional) – The lower quantile for the confidence interval, by default 0.025

  • upper (float, optional) – The upper quantile for the confidence interval, by default 0.975

  • ylabel (str, optional) – The label for the y-axis, by default “Sales”

  • idx (slice, optional) – The index slice of days to plot, by default None or only the positive days. More specifically, slice(0, None, None)

  • channels (List[str], optional) – The channels to plot, by default None or all channels

  • prior (bool, optional) – Whether to use the prior or posterior, by default False (posterior)

  • original_scale (bool, optional) – Whether to plot in the original scale of the target variable, by default True

  • ax (plt.Axes, optional) – The axes to plot on, by default None or current axes

  • **sample_posterior_predictive_kwargs – Additional keyword arguments passed to pm.sample_posterior_predictive

Returns:

The plot of upcoming sales for the given spend amount

Return type:

plt.Axes