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:
- name
str Name of the variable.
- param_config
Dict A configuration dictionary that must contain a ‘dist’ key with the name of the distribution and a ‘kwargs’ key with parameters for the distribution.
- mu
TensorVariable The mean of the likelihood distribution.
- observed
Union[np.ndarray,pd.Series] The observed data to which the likelihood distribution will be fitted.
- dims
str, sequence[str] The dimensions of the data.
- name
- Returns:
TensorVariableThe likelihood distribution constructed with PyMC.
- Raises:
UnsupportedDistributionErrorIf ‘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’