ResolvedPriceResponse#
- class pymc_marketing.mmm.price_response.ResolvedPriceResponse[source]#
A price response bound to one decision variable’s cell layout.
Built by
PriceResponse.resolve()and held byMediaVariable. How a family stores its coefficients is its own business; what the optimizer reads is per cell overdims(a family whose parameters vary by date reduces over it):money_scale, in money, below1e-12 * money_scaleof which a cell is reported as having bought nothing;curved, boolean, where the map bends money (u'' != 0), equal toPriceResponse.curved_cells()on the same layout and read before warning about a cell its bounds pin at zero; andis_identity, which keeps the constant-price graph operation for operation.Every map takes
spend, per-period money as anXTensorVariablewith dims(date_dim, *dims), andbase_price, the optimizer’scost_per_unittensor over the same dims orNonefor a base price of 1. A family implementsto_delivery()andimplied_marginal_price();implied_price()follows.Contract:
to_delivery()is non-decreasing and concave in money withu(0) = 0, and it andimplied_marginal_price()are finite, in value and gradient, on every cell including those outside the mask and those the map leaves unbent.whereevaluates both of its branches, so ananorinfin a branch that is not selected is harmless on the C backend and poisons the gradient under JAX.implied_price()is reported only, never differentiated, and isnanwhere nothing is delivered.Methods
ResolvedPriceResponse.__init__(*args, **kwargs)Money the next delivered unit costs at
spend: the reciprocal slope ofto_delivery.ResolvedPriceResponse.implied_price(spend[, ...])Average price of a delivered unit at
spend:spend / to_delivery(spend).ResolvedPriceResponse.to_delivery(spend[, ...])Delivered units bought with
spend.Attributes