Meridian GeoX is now available. Run geo experiments to calibrate your MMM.
Get started here
meridian.model.calibration.roi.get_calibrated_roi_prior
Stay organized with collections
Save and categorize content based on your preferences.
Calculates the calibrated ROI prior from one or more experiment results.
meridian.model.calibration.roi.get_calibrated_roi_prior(
calibration_data: Sequence[base.CalibrationData],
*,
channel_name: str,
total_channel_spend: float,
last_modeled_date: datetime.date,
adstock_decay_function: str,
alpha: float,
max_lag: int,
interval_days: int,
model_duration_days: int,
baseline_prior: (backend.tfd.Distribution | None) = None
) -> tuple[backend.tfd.Distribution, base.CalibrationOutput]
This function aggregates incrementality experiment results from one or more
experiments, applies spend, recency, and duration adjustments, and merges
them into a single joint prior distribution. If a baseline prior is provided,
its mean and variance are used to regularize the experiment results.
Args |
calibration_data
|
A sequence of
meridian.model.calibration.base.CalibrationData objects, each containing
an experiment result and associated experiment information.
|
channel_name
|
The name of the channel to calibrate.
|
total_channel_spend
|
The total spend of the channel in the Meridian model.
|
last_modeled_date
|
The last date of the modeled period in the Meridian
model.
|
adstock_decay_function
|
The adstock decay function used for duration
adjustments ('geometric' or 'binomial').
|
alpha
|
The decay rate parameter used for duration adjustments.
|
max_lag
|
The maximum lag value in model intervals.
|
interval_days
|
The interval size of the Meridian model time coordinates in
days.
|
model_duration_days
|
The number of days in the modeled period of the
Meridian model.
|
baseline_prior
|
An optional tfd.Distribution representing the baseline
prior for the KPI. If provided, the baseline prior will regularize the
incrementality experiment results.
|
Returns |
A tuple of (calibrated_prior, calibration_output), where:
- calibrated_prior: A tfd.Distribution representing the calibrated ROI
prior.
- calibration_output: A base.CalibrationOutput object containing output
diagnostics, baseline prior, and calibrated experiments.
|
Raises |
ValueError
|
If any of the following are true:
- No calibration data is provided for the channel.
- Total channel spend is less than or equal to 0.0.
- Average daily channel spend or average daily experiment spend is not
positive.
- The adstock decay function is invalid.
- The adjusted standard error factor (tau) is less than or equal to
-1.0.
- Posterior evaluation results in zero or non-finite probability mass.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-05 UTC.
[null,null,["Last updated 2026-11-05 UTC."],[],[]]