cleverly.datasets.pricing_truth#

cleverly.datasets.pricing_truth(factors: Iterable[float] = (1.06, 1.25), nodes: tuple[int, int] = (8, 24)) → dict[str, float][source]#

Return the exact mean renewal and revenue under each plan, and the effect of each plan.

A plan maps the price the engine would set to a new price. The mean outcome under the plan is a sum over the eight engagement paths of a Gauss–Legendre integral over usage and the three natural prices. The integral splits each price band at every break of the plan. The engagement and the engine’s next price respond to the assigned prices, as the law has them.

Parameters:
factorsiterable of float, default=(1.06, 1.25)

The factors of the extra price rises, beside the plans of PRICE_PLANS. A factor gives the plan price_rise(factor).

nodestuple of int, default=(8, 24)

The quadrature orders for one piece of a price band and for usage.

Returns:
dict of str to float

ey_regimen[<plan>] and ey_revenue[<plan>], the mean renewal and the mean revenue under each plan. ate_regimen[<plan> vs natural_prices] and ate_revenue[<plan> vs natural_prices], the effect of each plan on both. These are the labels a fit reports. ate_engagement_held[<plan>], ate_engine_held[<plan>] and ate_both_held[<plan>] for price_up and price_down, the decomposition below.

See also

make_sequential_pricing

The generator whose law this truth integrates.

PRICE_PLANS

The plans this function evaluates.

price_rise

A plan with another factor.

Notes

An outcome regression on the usage, the engagement, and the prices can hold two things at the values the engine’s own prices produced. The decomposition keys give the effect on renewal when the plan’s prices enter the renewal model and one or both of these stay natural.

  • ate_engagement_held: the engagement model reads the natural price gap.

  • ate_engine_held: the engine’s next price mean reads the natural price gap.

  • ate_both_held: both read the natural gap. This is the limit of the estimate from a logistic regression of the renewal on the usage, the engagement, and the three prices, with the prices replaced by the plan’s prices.

Examples

>>> from cleverly.datasets import pricing_truth
>>> truth = pricing_truth()
>>> round(truth["ate_regimen[price_up vs natural_prices]"], 4)
-0.1003
>>> truth["ate_regimen[price_down vs natural_prices]"] > 0.1
True