create_likelihood_distribution#

pymc_marketing.model_config.create_likelihood_distribution(name, param_config, mu, observed, dims)[source]#

Create observed variable for the model.

This method prepares the distribution and its parameters as specified in the configuration dictionary, validates them, and constructs the likelihood distribution using PyMC.

Parameters:
namestr

Name of the variable.

param_configDict

A configuration dictionary that must contain a ‘dist’ key with the name of the distribution and a ‘kwargs’ key with parameters for the distribution.

muTensorVariable

The mean of the likelihood distribution.

observedUnion[np.ndarray, pd.Series]

The observed data to which the likelihood distribution will be fitted.

dimsstr, sequence[str]

The dimensions of the data.

Returns:
TensorVariable

The likelihood distribution constructed with PyMC.

Raises:
UnsupportedDistributionError

If ‘kwargs’ key is missing in dist, or the parameter configuration does not contain ‘dist’ and ‘kwargs’ keys, or if ‘mu’ is present in the nested ‘kwargs’