NestedLogit.calculate_share_change#

static NestedLogit.calculate_share_change(idata, new_idata)[source]#

Calculate difference in market share due to market intervention.

Parameters:
idataaz.InferenceData

Posterior predictive samples under the baseline (pre-intervention) policy. Must contain a “posterior_predictive” group with a “p” variable representing predicted market shares.

new_idataaz.InferenceData

Posterior predictive samples under the new (post-intervention) policy. Structure should match idata, with a “posterior_predictive” group containing “p”.

Returns:
pd.DataFrame

A DataFrame indexed by product, containing: - ‘policy_share’: mean predicted share under the baseline policy - ‘new_policy_share’: mean predicted share under the new policy - ‘relative_change’: relative change in share due to the intervention