新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
結果が収益でない場合にカスタムの事前分布を設定する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
メリディアンでは、結果の増分を費用で割ったものが ROI と定義されます。しかし、KPI が収益ではなく、revenue_per_kpi
が InputData
に渡されていない場合、結果は収益では表されません。そのため、カスタムの ROI 事前分布を特定するのは難しくなる場合があります。
結果が収益でない場合にカスタム事前分布を設定するには、次のオプションをご検討ください。
有料メディアによる KPI の増分の全体に対する割合がおおよそわかっている場合は、次のように処理することで、メディアの合計貢献度の平均と標準偏差が特定の値に設定された共通の ROI 事前分布をすべてのチャネルに設定できます。
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),
)
ここで、
kpi
は、地域と時間全体の KPI の合計です。
cost
は、地域と時間全体でのチャネルあたりの合計費用の配列です。
この例では、すべてのメディアの KPI 貢献度は 50% を中心としており、標準偏差は 15% です。次に、有料メディアの合計貢献度に関する暗黙的な事前分布の平均が 50%、標準偏差が 15% になるように、すべてのチャネルで一定の ROI 事前分布を取得します。得られた事前分布 roi_prior
は、roi_m
または roi_rf
の PriorDistribution
コンテナに設定して使用できます。
有料メディアの合計貢献度の事前分布は、個々のチャネルのおおよその値がわかっている必要がないため、有用な場合があります。ただし、各チャネルに関する追加の知識や直感がある場合は、IKPC の事前分布またはチャネルレベルの貢献度の事前分布を設定することを検討してください。
カスタムの費用あたり増分 KPI(IKPC)の事前分布
チャネルの費用あたり増分 KPI(IKPC)のおおよその値がわかっている場合は、PriorDistribution
コンテナで roi_m
または roi_rf
を使用して IKPC の事前分布を設定できます。revenue_per_kpi
が設定されていない場合、ROI はメリディアンの IKPC と同等です。
例:
roi_prior = tfp.distributions.LogNormal([0.5, 0.6, 0.7], [0.5, 0.5, 0.5])
ただし、これは、すべてのメディア チャネルにカスタムの IKPC の事前分布を設定する場合にのみおすすめします。revenue_per_kpi=None
のデフォルトの ROI 事前分布は、ROI が単位なしスケールである収益 KPI 用に設計されていることから、データに適さない傾向があるためです。IKPC がおおよそわかっているチャネルが一部だけの場合でも、その他のチャネルに対し、妥当なデフォルトの IKPC の事前分布を設定する必要があります。IKPC は、新登場の車やチョコバーなど、スケールに大きく依存するため、メリディアンには推奨されるデフォルトの IKPC の事前分布はありません。
チャネルレベルの貢献度の事前分布
KPI の増分について、特定のチャネルが貢献している比率がおおよそわかっている場合は、ModelSpec
で media_prior_type='contribution'
と rf_prior_type='contribution'
を設定し、PriorDistribution
で contribution_m
と contribution_rf
の事前分布をカスタマイズすることで、特定のチャネルの貢献度事前分布を設定できます。次に例を示します。
prior = prior_distribution.PriorDistribution(
contribution_m=tfp.distributions.Beta([1, 5], [99, 95]),
contribution_rf=tfp.distribution.Beta(2, 98),
)
model_spec = spec.ModelSpec(
prior=prior,
media_prior_type="contribution",
rf_prior_type="contribution",
)
この例では、2 つのメディア チャネルがあります。1 つ目には、平均が 1% の貢献度事前分布 Beta(1, 99) を割り当てます。2 つ目には、平均が 5% の貢献度事前分布 Beta(5, 95) を割り当てます。R&F チャネルには、平均が 2% の貢献度事前分布 Beta(2, 98) をそれぞれ割り当てます。(tfp.distribution.Beta(2, 98)
はスカラー分布であるため、すべての R&F チャネルにブロードキャストされます)。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-17 UTC。
[null,null,["最終更新日 2025-08-17 UTC。"],[[["\u003cp\u003eMeridian calculates ROI as incremental outcome divided by spend, and when the KPI is not revenue, the outcome is not in terms of revenue.\u003c/p\u003e\n"],["\u003cp\u003eWhen the outcome is not revenue, setting a custom prior is possible via three options: Custom total paid media contribution prior, Custom incremental KPI per cost (IKPC) prior, or Channel-level contribution prior.\u003c/p\u003e\n"],["\u003cp\u003eSetting a custom total paid media contribution prior allows users to define the proportion of the KPI that is incremental due to all paid media channels, using a mean and standard deviation.\u003c/p\u003e\n"],["\u003cp\u003eCustom IKPC priors are set using \u003ccode\u003eroi_m\u003c/code\u003e or \u003ccode\u003eroi_rf\u003c/code\u003e, but it is recommended to set them for all media channels because the default ROI priors may not be appropriate, and there is no recommended default IKPC prior from Meridian.\u003c/p\u003e\n"],["\u003cp\u003eSetting a channel-level contribution prior allows users to set a prior on the contribution of a given channel, again it is recommended to do this for every media channel because the default priors may not be appropriate, and there is no recommended default media contribution prior from Meridian.\u003c/p\u003e\n"]]],[],null,["# Set custom priors when outcome is not revenue\n\nMeridian defines ROI as incremental outcome divided by spend. When the KPI is\nnot revenue and `revenue_per_kpi` is not passed to `InputData`,\n[outcome](/meridian/docs/basics/glossary) is not in terms of\nrevenue. This can make it difficult to determine a custom ROI prior.\n\nConsider the following options when setting a custom prior when outcome is not\nrevenue:\n\n- [Custom total paid media contribution prior](#set-total-paid-media-contribution-prior)\n- [Custom incremental KPI per cost (IKPC) prior](#set-ikpc-prior)\n- [Channel-level contribution prior](#set-channel-contribution-prior)\n\nCustom total paid media contribution prior\n------------------------------------------\n\nIf you have intuition about the total proportion of the KPI that is incremental\ndue to paid media, you can set a common ROI prior on all channels such that the\ntotal media contribution specific prior mean and standard deviation by doing the\nfollowing: \n\n p_mean = 0.5 # prior mean proportion of KPI incremental due to all media\n p_sd = 0.15 # prior std dev proportion of KPI incremental to all media\n roi_mean = p_mean * kpi / np.sum(cost)\n roi_sd = p_sd * kpi / np.sqrt(np.sum(np.power(cost, 2)))\n lognormal_sigma = np.sqrt(np.log(roi_sd**2 / roi_mean**2 + 1))\n lognormal_mu = np.log(roi_mean * np.exp(-lognormal_sigma**2 / 2))\n roi_prior = tfp.distributions.LogNormal(\n lognormal_mu.astype(np.float32),\n lognormal_sigma.astype(np.float32),\n )\n\nWhere:\n\n- `kpi` is the sum of the entire KPI across geos and time.\n- `cost` is an array of the total cost per channel across geos and time.\n\nIn this example, the KPI contribution of all media is centered at 50% with a\nstandard deviation of 15%. You then get an ROI prior that is consistent for all\nchannels, such that the implied prior on the total paid media contribution has a\nmean at 50% and a standard deviation at 15%. The derived prior, `roi_prior`, can\nthen be used by setting it in the `PriorDistribution` container for `roi_m` or\n`roi_rf`.\n\nThe total paid media contribution prior can be advantageous as it doesn't\nrequire intuition on each individual channel. However, if additional knowledge\nor intuition about each channel is available, then consider setting a [IKPC\nprior](#set-ikpc-prior) or\n[channel-level contribution\nprior](#set-channel-contribution-prior).\n\nCustom incremental KPI per cost (IKPC) prior\n--------------------------------------------\n\nIf you have intuition about a channel's incremental KPI per cost (IKPC), you can\nset a IKPC prior using `roi_m` or `roi_rf` in the `PriorDistribution` container.\nWhen `revenue_per_kpi` is not set, ROI is equivalent to IKPC in\nMeridian.\n\n**Example:** \n\n roi_prior = tfp.distributions.LogNormal([0.5, 0.6, 0.7], [0.5, 0.5, 0.5])\n\nHowever, we only recommend doing this if you are going to set a custom IKPC\nprior for every media channel. This is because the default ROI priors with\n`revenue_per_kpi=None` likely won't make sense for your data as it designed for\nrevenue KPIs where the ROI would be on the unitless scale. If you only have\nintuition on the IKPC for some channels, you still must set some reasonable\ndefault IKPC prior for the other channels. Meridian doesn't have a\nrecommended default IKPC prior because IKPC is strongly dependent on the scale,\nfor example, a new car or a candy bar.\n\nChannel-level contribution prior\n--------------------------------\n\nIf you have intuition about the proportion of the KPI that is incremental due to\na given channel, you can set a prior on the contribution of a given\nchannel by setting `media_prior_type='contribution'` and\n`rf_prior_type='contribution'` in the `ModelSpec` and customizing the prior\ndistributions on `contribution_m` and `contribution_rf` in the\n`PriorDistribution`. The following is an example. \n\n prior = prior_distribution.PriorDistribution(\n contribution_m=tfp.distributions.Beta([1, 5], [99, 95]),\n contribution_rf=tfp.distribution.Beta(2, 98),\n )\n model_spec = spec.ModelSpec(\n prior=prior,\n media_prior_type=\"contribution\",\n rf_prior_type=\"contribution\",\n )\n\nIn this example, there are two media channels. The first is assigned a Beta(1,\n99) contribution prior, which has a mean of 1%. The second is assigned a Beta(5,\n95) contribution prior, which has a mean of 5%. The R\\&F channels are each\nassigned a contribution prior of Beta(2, 98), which has a mean of 2%. (Note that\n`tfp.distribution.Beta(2, 98)` is a scalar distribution, so it is broadcast to\nall R\\&F channels)."]]