add_lift_measurements_to_likelihood_from_saturation#

pymc_marketing.mmm.lift_test.add_lift_measurements_to_likelihood_from_saturation(df_lift_test, saturation, time_varying_var_name=None, model=None, dist=<class 'pymc.dims.distributions.scalar.Gamma'>, name='lift_measurements', get_indices=<function exact_row_indices>)[source]#

Add lift measurements to the likelihood from a saturation transformation.

Wrapper around add_saturation_observations() to work with SaturationTransformation instances and time-varying variables.

Used internally of the MMM class.

Parameters:
df_lift_testpd.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.

saturationSaturationTransformation

Any SaturationTransformation instance.

time_varying_var_namestr, optional

Name of the time-varying variable in model.

modelOptional[Model], optional

PyMC model with arbitrary number of coordinates, by default None

distpymc.dims.Distribution class, optional

PyMC distribution to use for the likelihood, by default Gamma

namestr, optional

Name of the likelihood, by default “lift_measurements”

get_indicesCallable[[pd.DataFrame, pm.Model], Indices], optional

Function to get the indices of the DataFrame in the model, by default exact_row_indices which assumes that the columns map exactly to the model coordinates.