estimate_sigmoid_parameters#

pymc_marketing.mmm.utils.estimate_sigmoid_parameters(channel, original_dataframe, contributions, **kwargs)[source]#

Estimate the parameters for the sigmoid function using curve fitting.

This function extracts the relevant data for the specified channel from both the original_dataframe and contributions DataArray resulting from the model. It then utilizes scipy’s curve_fit method to find the optimal parameters for an sigmoid function, aiming to minimize the least squares difference between the observed and predicted data.

Parameters:
channelstr

The name of the marketing channel for which parameters are to be estimated.

original_dataframeUnion[pd.DataFrame, Any]

The original DataFrame containing the channel data.

contributionsxr.DataArray

An xarray DataArray containing the contributions data, indexed by channel.

Returns:
List[float]

The estimated parameters of the extended sigmoid function.