BudgetOptimizer#
- class pymc_marketing.mmm.budget_optimizer.BudgetOptimizer(adstock, saturation, num_days, parameters, adstock_first=True)[source]#
A class for optimizing budget allocation in a marketing mix model.
The goal of this optimization is to maximize the total expected response by allocating the given budget across different marketing channels. The optimization is performed using the Sequential Least Squares Quadratic Programming (SLSQP) method, which is a gradient-based optimization algorithm suitable for solving constrained optimization problems.
For more information on the SLSQP algorithm, refer to the documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html
- Parameters:
- adstock
AdstockTransformation The adstock class.
- saturation
SaturationTransformation The saturation class.
- num_days
int The number of days.
- parameters
dict A dictionary of parameters for each channel.
- adstock_firstbool, optional
Whether to apply adstock transformation first or saturation transformation first. Default is True.
- adstock
Methods
BudgetOptimizer.__init__(adstock, ...[, ...])BudgetOptimizer.allocate_budget(total_budget)Allocate the budget based on the total budget, budget bounds, and custom constraints.
BudgetOptimizer.objective(budgets)Calculate the total response during a period of time given the budgets, considering the saturation and adstock transformations.