innovate.policy.intervention module

class innovate.policy.intervention.PolicyIntervention(model: DiffusionModel)[source]

Bases: object

A class to apply policy interventions to a diffusion model.

apply_time_varying_params(t_points: Sequence[float], p_effect: Callable[[float], float] = None, q_effect: Callable[[float], float] = None) Callable[[Sequence[float]], Sequence[float]][source]

Applies time-varying effects to ‘p’ and ‘q’ parameters of the model. This method is specifically designed for Bass-like models.

Parameters:
  • t_points – A sequence of time points for which to apply the effects.

  • p_effect – A callable that takes time (float) and returns a multiplier for ‘p’.

  • q_effect – A callable that takes time (float) and returns a multiplier for ‘q’.

Returns:

A callable that takes a sequence of time points and returns predictions with the applied time-varying policy effects.