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
MMMclass.- 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.
- saturation
SaturationTransformation Any SaturationTransformation instance.
- time_varying_var_name
str, optional Name of the time-varying variable in model.
- model
Optional[Model], optional PyMC model with arbitrary number of coordinates, by default None
- dist
pymc.dims.Distributionclass, optional PyMC distribution to use for the likelihood, by default Gamma
- name
str, optional Name of the likelihood, by default “lift_measurements”
- get_indices
Callable[[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.
- df_lift_test