OptimizationVariable#
- class pymc_marketing.mmm.optimization_variables.OptimizationVariable[source]#
One named, contiguous segment of the flat decision vector.
A variable describes a single model variable that the optimizer controls: how its slice of the flat vector becomes the model-space tensor substituted into the graph (
to_model()), how a solution slice becomes a labelledDataArray(unpack()), and the exact inverse of that labelling (pack()).- Attributes:
- name
str Name of the model variable this variable substitutes.
- dims
tuple[str, …] Dimension names of the variable’s labelled representation.
- coords
dict[str,list] Coordinates for
dims.- flat_dim
str Name of the flat decision vector’s dimension. Owned by the containing
OptimizationVariables, which assigns it at construction.
- name
Methods
OptimizationVariable.__init__(*args, **kwargs)Monetary amount this variable draws from the shared budget.
OptimizationVariable.default_bounds(total_budget)Default
(low, high)bounds per flat entry.OptimizationVariable.default_x0(total_budget)Default initial guess for this variable's slice.
Exact inverse of
unpack().Map this variable's slice of the flat vector to its model-space tensor.
Map a solution slice to a labelled
DataArray.Attributes
sizeNumber of entries this variable occupies in the flat vector.
namedimscoordsflat_dim