Set custom priors when outcome is not revenue

Meridian defines ROI as incremental outcome divided by spend. When the KPI is not revenue and revenue_per_kpi is not passed to InputData, outcome is not in terms of revenue. This can make it difficult to determine a custom ROI prior.

Consider the following options when setting a custom prior when outcome is not revenue:

Custom total paid media contribution prior

If you have intuition about the proportion of the KPI that is incremental due to all paid media channels that differs from the default, you can set a mean and standard deviation for this proportion by doing the following:

p_mean = 0.5  # prior mean proportion of KPI incremental due to all media
p_sd = 0.15  # prior std dev proportion of KPI incremental to all media
roi_mean = p_mean * kpi / np.sum(cost)
roi_sd = p_sd * kpi / np.sqrt(np.sum(np.power(cost, 2)))
lognormal_sigma = np.sqrt(np.log(roi_sd**2 / roi_mean**2 + 1))
lognormal_mu = np.log(roi_mean * np.exp(-lognormal_sigma**2 / 2))
roi_prior = tfp.distributions.LogNormal(lognormal_mu.astype(np.float32), lognormal_sigma.astype(np.float32))

Where:

  • kpi is the sum of the entire KPI across geos and time.
  • cost is an array of the total cost per channel across geos and time.

In this example, the KPI contribution of all media is centered at 50% with a standard deviation of 15%. You then get an ROI prior that is consistent for all channels, such that the implied prior on the total paid media contribution has a mean at 50% and a standard deviation at 15%. The derived prior, roi_prior, can then be used by setting it in the PriorDistribution container for roi_m or roi_rf.

The total paid media contribution prior can be advantageous as it doesn't require intuition on each individual channel. However, if additional knowledge or intuition about each channel is available, then consider setting a IKPC prior or channel-level contribution prior.

Custom incremental KPI per cost (IKPC) prior

If you have intuition about a channel's incremental KPI per cost (IKPC), you can set a IKPC prior using roi_m or roi_rf in the PriorDistribution container. When revenue_per_kpi is not set, ROI is equivalent to IKPC in Meridian.

Example:

roi_prior = tfp.distributions.LogNormal([0.5, 0.6, 0.7], [0.5, 0.5, 0.5])

However, we only recommend doing this if you are going to set a custom IKPC prior for every media channel. This is because the default ROI priors with revenue_per_kpi=None likely won't make sense for your data as it designed for revenue KPIs where the ROI would be on the unitless scale. If you only have intuition on the IKPC for some channels, you still must set some reasonable default IKPC prior for the other channels. Meridian doesn't have a recommended default IKPC prior because IKPC is strongly dependent on the scale, for example, a new car or a candy bar.

Channel-level contribution prior

If you have intuition about the proportion of the KPI that is incremental due to a given channel, you can effectively set a prior on the contribution of a given channel by doing the following:

tfb = tfp.bijectors
contribution_prior = tfp.distributions.TruncatedNormal(0.25, 0.15, 0, 1)
roi_prior = tfp.distributions.TransformedDistribution(contribution_prior,
                                                      tfb.Scale(kpi/cost_m))

Where:

  • kpi is the sum of the entire KPI across geos and time.
  • cost_m is the total cost of the given channel across geos and time.

In this example, the KPI contribution of the channel is centered at 25% and the prior is truncated at 0% and 100%. The derived prior, roi_prior, can then be used by setting it in the PriorDistribution container for roi_m or roi_rf.

Similar to IKPC priors, we only recommend doing this if you are going to set a custom contribution prior for every media channel. This is because the default ROI priors with revenue_per_kpi=None likely won't make sense for your data. If you only have intuition on the media contribution for some channels, you still must set some reasonable default media contribution prior for the other channels. Meridian doesn't have a recommended default media contribution prior.