taste_profiles#
Post-hoc taste-profile analysis for fitted BayesianBLP models.
This module exposes the lenses the demo notebooks use to characterise who buys in each market, given the posterior over preference parameters and the Halton grid of consumer types attached to the model:
buyer_nu_posterior()posterior of average buyer \(\bar\nu_{m,d}\)brand_buyer_nu()brand-level buyer profile \(\bar\nu_{m,j,d}\)demand_concentration_gini()Gini of inside-good demand across typestaste_type_demand_share()bucketed sensitive / modal / insensitive sharesconsumer_taste_grid()the Halton grid as a labelled DataFrame
Plus four convenience plotters that wrap each computation in a standard
matplotlib figure with layout="constrained" so colorbar layouts compose
cleanly with the rest of pymc-marketing’s notebook style.
All public functions take a fitted BayesianBLP model and raise
RuntimeError when the model has no posterior. The single internal helper
_compute_inside_choice_probs() is the only place that reaches into the
model’s private API; all public functions delegate through it.
Functions
|
Posterior-mean buyer taste per brand and market, for one taste dimension. |
|
Posterior of the average buyer's taste vector per market. |
|
Halton grid as a labelled DataFrame. |
|
Per-sample Gini of inside-good demand across consumer types, per market. |
|
|
|
|
|
Gini coefficient of inside-good demand vs. average market price. |
|
Stacked area chart of consumer allocation across the \(\nu_{\mathrm{price}}\) axis. |
|
Share of inside-good demand contributed by each price-taste bucket. |