OptimizationVariables#
- class pymc_marketing.mmm.optimization_variables.OptimizationVariables(variables, flat_name='budgets_flat', flat_dim='budgets_flat')[source]#
The complete decision vector: an ordered list of variables.
Owns the single flat symbolic input, the contiguous slice layout, and the forward/inverse maps between the flat vector and per-variable labelled
DataArrayobjects. The slice layout tiles[0, size)exactly: variables are laid out in order with no gaps or overlaps.- Parameters:
- variables
list[OptimizationVariable] Variables in flat-vector order.
- flat_name
str Name of the flat symbolic variable.
- flat_dim
str Dimension name of the flat symbolic variable.
- variables
Methods
OptimizationVariables.__init__(variables[, ...])OptimizationVariables.bounds(total_budget[, ...])Assemble per-entry bounds, variable by variable.
Monetary contributions of every variable that spends from the pot.
OptimizationVariables.pack(values)Assemble a flat vector from labelled per-variable values.
Return the variables that draw from the shared budget.
Model substitution dict: one entry per variable, one joint graph.
Split a flat solution into labelled per-variable
DataArrayobjects.Return the symbolic slice of the flat vector for variable
name.OptimizationVariables.x0(total_budget)Default initial guess: each variable's
default_x0concatenated.