MixedLogit.apply_intervention#
- MixedLogit.apply_intervention(new_choice_df, new_utility_equations=None, fit_kwargs=None)[source]#
Apply intervention by changing observable attributes or market structure.
This method supports two intervention strategies:
1. Observable attribute changes: Uses the existing fitted model and modifies observable inputs (e.g., prices, features) to simulate how choices change. Uses posterior predictive sampling with the existing random coefficient draws.
2. Product removal/addition: Allows alternatives to be added or removed from the choice set. This re-specifies and re-estimates the model.
- Parameters:
- new_choice_df
pd.DataFrame The new dataset reflecting changes to observable attributes or product availability.
- new_utility_equations
list[str] |None, optional An updated list of utility specifications for each alternative, if different from the original model. If None, the original equations are reused and only the data is changed.
- fit_kwargs
dict|None, optional Keyword arguments for sampling if refitting the model.
- new_choice_df
- Returns:
az.InferenceDataThe posterior or full predictive distribution under the intervention.