MMMIDataWrapper.from_mmm#

classmethod MMMIDataWrapper.from_mmm(mmm, idata=None)[source]#

Create an MMMIDataWrapper from a fitted MMM model.

Builds the appropriate schema from the model configuration and wraps the provided (or model’s own) InferenceData.

Parameters:
mmmMMM

Fitted MMM model instance.

idataaz.InferenceData, optional

InferenceData to wrap. If None, uses mmm.idata.

Returns:
MMMIDataWrapper

Wrapper with schema derived from the model configuration.

Raises:
ValueError

If no idata is provided and mmm.idata is not available.

Examples

>>> wrapper = MMMIDataWrapper.from_mmm(mmm)
>>> wrapper = MMMIDataWrapper.from_mmm(mmm, idata=custom_idata)