price_response#

Spend-dependent price of a delivered media unit, for the budget optimizer.

cost_per_unit answers “what does one unit cost in period t”. It cannot say that the price of a unit depends on how much is bought in that period, which is what auction bid-up and rate-card tiers do, and it bites exactly where budget optimization is used: with a constant price every marginal return the optimizer sees is an upper bound, and it is too high precisely on the channels it is choosing to grow.

A PriceResponse is a non-decreasing, concave map from per-period money to delivered units. It is applied inside the optimizer’s differentiable graph, on unscaled money and before channel_scales, with cost_per_unit as the base price. The decision variables, the bounds and every constraint stay in money; the model graph keeps receiving units.

One parametric form ships, PowerPriceResponse, whose elasticity=0 reproduces the constant-price optimizer operation for operation.

Precondition#

The feature is only sound when the model was fitted on delivery units (impressions, clicks), or on spend restated into constant prices. A model fitted on nominal spend has already absorbed part of the price curvature into its saturation curve, because price and volume moved together historically; a concave price map on top bends the same curve twice and understates marginal return. The optimizer cannot check this: the fitted model carries no evidence of the units of its data, and its historical cost_per_unit table is a declaration that set_cost_per_unit() writes after the fit without touching the model. So a response that bends money anywhere requires assume_delivery_units=True. The historical table then anchors reference_spend on the channels it prices; every other curved cell needs a reference_spend.

Classes

PowerPriceResponse(*[, elasticity, ...])

Iso-elastic price: the unit price rises as a power of the money spent in the period.

PriceResponse()

A non-decreasing, concave map from per-period money to delivered units, declared once and bound per variable.

ResolvedPowerPriceResponse(*, gamma, ...)

The iso-elastic map bound to a layout, with a quadratic floor at low spend.

ResolvedPriceResponse()

A price response bound to one decision variable's cell layout.