indices_from_lift_tests#

pymc_marketing.mmm.lift_test.indices_from_lift_tests(df_lift_test, model, var_names)[source]#

Get the indices of the lift test results in the model.

These are the mapping from the lift test result to the index of the corresponding variable in the model.

Parameters:
  • df_lift_test (pd.DataFrame) –

    DataFrame with lift test results with at least the following columns:
    • x: x axis value of the lift test.

    • delta_x: change in x axis value of the lift test.

    • delta_y: change in y axis value of the lift test.

    • sigma: standard deviation of the lift test.

    Any additional columns are assumed to be coordinates in the model.

  • model (pm.Model) – PyMC model with arbitrary number of coordinates.

  • var_names (list[str]) – List of variable names in the model.

Returns:

Dictionary of indices for the lift test results in the model.

Return type:

dict[str, np.ndarray]