MaxDiffMixedLogit.score_new_items#
- MaxDiffMixedLogit.score_new_items(new_item_attributes)[source]#
Compute posterior share-of-preference after introducing new items.
Part-worths mode only. Each row of
new_item_attributesis a hypothetical SKU not seen during training. The fitted patsy formula is applied viatransform_attributes()to obtain design vectors for the new items; utilities follow from the posterior ofbeta_feat. The share-of-preference is computed over the extended pool (training items first, new items appended).This is the Type 2 intervention (market-structure change — adding new items to the competitive set).
- Parameters:
- new_item_attributes
pd.DataFrame One row per new item, indexed by a unique item name, with the same attribute columns as the training
item_attributes. Item names must not overlap with the training pool.
- new_item_attributes
- Returns:
xr.DatasetVariables
u_itemandshare_of_preference, both of shape(chain, draw, items), where theitemscoordinate covers training items followed by new items. The result is also stored asself.intervention_idata.
- Raises:
RuntimeErrorIf called on a non-part-worths model or before fitting.
ValueErrorIf any new item name overlaps with the training pool.