Explanation: Optimisation Concepts

This document explains the core concepts behind the budget optimisation process in Abacus, including the response curve models used.

Response Curve Models

Abacus leverages distinct response curve models, derived from the fitted MMM parameters, to capture the relationship between marketing spend and its contribution for the purpose of optimisation. These models exhibit diminishing returns.

Michaelis-Menten Model

Originating from enzyme kinetics, this model assumes diminishing returns to scale.

  • Formula:

    \[C(S) = \frac{L \times S}{k + S}\]

    Where S is spend, L is the maximum contribution (saturation), and k is the spend at half-maximum contribution (lower k means higher efficiency).

  • Characteristics: Always positive, decreasing marginal return (dC/dS > 0, d^2C/dS^2 < 0). Elasticity E = k / (k + S).

  • Parameters (derived for optimisation): beta (max effect), lam (shape/steepness).

Michaelis-Menten Curve

*(Note: Image path adjusted relative to new location)*

Logistic Saturation Model

Provides a classic S-shaped curve.

  • Formula (example, related to model implementation): The contribution is often proportional to a logistic function applied to the adstocked spend.

  • Characteristics: S-shaped, diminishing returns, approaches a maximum value.

  • Parameters (derived for optimisation): beta (max effect), lam (shape/steepness).

(Note: The specific functional forms used internally for optimisation might be simplified representations derived from the full model’s transformations.)

Deriving Parameters for Optimisation

Crucially, the parameters used in the optimisation objective function are not estimated by fitting separate curves to decomposed contributions after the main MMM run. Instead, they are derived directly from the posterior means of the fitted MMM parameters.

  • Method: The function abacus.core.opt.compute_channel_curve_optimization_parameters_original_scale takes the posterior means of the relevant MMM parameters (like beta_channel, alpha, lam from the main model fit) and calculates the effective response curve parameters (beta, lam) for the chosen optimisation method (‘michaelis-menten’ or ‘logistic’) based on the mathematical relationship between the MMM transformations and these simpler curve forms.

  • Rationale: This ensures the optimisation uses response characteristics consistent with the fitted Bayesian model, rather than relying on a potentially noisy secondary fitting process. The uncertainty from the original model fit is implicitly carried forward via the use of posterior means.

Budget Optimisation Objective

The goal is to find the spend allocation (S_1, S_2, ..., S_n) across n channels that maximises the total expected contribution, subject to constraints.

  • Objective Function:

    \[maximize \sum_{i=1}^{n} C_i(S_i)\]

    Where C_i(S_i) is the contribution predicted by the estimated response curve for channel i given spend S_i.

Constraints

  • Total Budget: The sum of allocated spends must equal the total available budget (B).

    \[\sum_{i=1}^{n} S_i = B\]
  • Non-Negativity: Spend for each channel must be non-negative.

    \[S_i \ge 0\]
  • Optional Bounds: User-defined minimum (S_i^{min}) and maximum (S_i^{max}) spend limits can be applied to individual channels.

    \[S_i^{min} \leq S_i \leq S_i^{max}\]

Optimisation Algorithm (SLSQP)

Abacus uses Sequential Least Squares Quadratic Programming (SLSQP), an iterative algorithm suitable for constrained non-linear optimisation. It finds the optimal allocation by:

  1. Starting with an initial guess.

  2. Calculating gradients (rates of change) of the objective and constraints.

  3. Determining a search direction to improve the objective while respecting constraints.

  4. Calculating a step size.

  5. Updating the allocation.

  6. Repeating until convergence criteria (optimality and feasibility tolerances) are met.

Forecasting Contributions

Once the optimal budget S_i^* for each channel is found, the expected contribution for each channel C_i(S_i^*) and the total contribution sum(C_i(S_i^*)) can be calculated using the fitted response curves. Uncertainty quantification around these forecasts can involve considering the uncertainty in the estimated response curve parameters.