新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
過去のテストを基にカスタムの ROI 事前分布を設定する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
メリディアンでは、費用対効果の調整用の分布を渡す必要があります。以前のテスト結果を使用してカスタムの事前分布を設定する方法に問題はありませんが、その場合は事前に考慮すべき注意点がいくつかあります。次に例を示します。
MMM の期間を基準としたテストのタイミング: MMM の期間の前または後にテストを実施した場合、その結果は直接適用できないことがあります。
テストの期間: テストの期間が短いと、マーケティング効果の長期的な影響を効果的に把握できない可能性があります。
テストの複雑さ: テストに複数のチャネルが含まれている場合、結果から個々のチャネルのパフォーマンスに関する明確な分析情報が得られないことがあります。
エスティマンドの違い: テストで使用されるエスティマンドは、MMM で使用されるものとは異なる場合があります。たとえば、MMM の反事実的条件法は費用ゼロですが、一部のテストでは、費用の削減など、異なる反事実的条件法が使用される場合があります。
人口の違い: テストのターゲットとする人口は、MMM で考慮される人口とは異なる場合があります。
チャネルの効果に関する仮説に基づいて、カスタムの事前分布を設定することをおすすめします。事前仮説については、テストやその他の信頼できる分析データなど、さまざまな情報源から情報を得ることができます。その事前仮説の信頼度を、事前分布の標準偏差に活かします。
チャネルの効果についての仮説に対し、強い確信がある場合は、事前分布の標準偏差に調整係数を適用し、信頼度を反映させることができます。たとえば、特定のチャネルに対して複数のテストを行い、すべてのテストで類似した費用対効果ポイントの推定値が得られた場合や、そのチャネルの有効性を裏付ける過去の MMM 分析のデータがある場合などです。このケースでは、分布が大きく変動しないように、事前分布の標準偏差を小さく設定できます。そのように分布を狭くすると、テスト結果に対する信頼度が高いという意味になります。
逆に、前述の注意点によっては、テスト結果が MMM に変換されないこともあります。その場合は、調整係数を事前分布の標準偏差に適用することもできます。たとえば、懐疑的な場合は、その程度に応じて事前分布の標準偏差を大きめに設定できます。
ModelSpec
で roi_calibration_period
引数を使用することをおすすめします。詳細については、費用対効果調整期間の設定をご確認ください。
事前分布の設定には LogNormal
分布がよく使用されます。次のサンプルコードを使用すると、テストの平均値と標準誤差を LogNormal
の事前分布に変換できます。
import numpy as np
def estimate_lognormal_dist(mean, std):
"""Reparameterization of lognormal distribution in terms of its mean and std."""
mu_log = np.log(mean) - 0.5 * np.log((std/mean)**2 + 1)
std_log = np.sqrt(np.log((std/mean)**2 + 1))
return [mu_log, std_log]
ただし、以前のテスト結果がゼロに近い場合は、LogNormal
分布などの負ではない分布によって、事前仮説が正確に表されているかどうかを確認する必要があります。分析を進める前に、事前分布をプロットして、事前の考えと一致しているか確認することを強くおすすめします。次のサンプルコードは、再パラメータ化された LogNormal
パラメータを取得し、分布を定義して、そこからサンプルを抽出する方法を示しています。
import tensorflow as tf
import tensorflow_probability as tfp
# Get reparameterized LogNormal distribution parameters
mu_log, std_log = estimate_lognormal_dist(mean, std)
mu_log = tf.convert_to_tensor(mu_log, dtype=tf.float32)
std_log = tf.convert_to_tensor(std_log, dtype=tf.float32)
# Define the LogNormal distribution
lognormal_dist = tfp.distributions.LogNormal(mu_log, std_log)
# Draw 10,000 samples
lognormal_samples = lognormal_dist.sample(10000).numpy()
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-17 UTC。
[null,null,["最終更新日 2025-08-17 UTC。"],[[["\u003cp\u003eMeridian's ROI calibration can be enhanced by incorporating prior knowledge from past experiments, but factors like experiment timing, duration, complexity, estimand, and population differences need careful consideration for accurate application.\u003c/p\u003e\n"],["\u003cp\u003ePrior beliefs about channel effectiveness should guide the standard deviation of the prior distribution, with stronger beliefs corresponding to tighter distributions and vice-versa.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eroi_calibration_period\u003c/code\u003e argument in \u003ccode\u003eModelSpec\u003c/code\u003e offers further control over the calibration process.\u003c/p\u003e\n"],["\u003cp\u003eWhile the \u003ccode\u003eLogNormal\u003c/code\u003e distribution is commonly used for setting priors, its suitability should be evaluated when experimental results are near zero, potentially requiring alternative distributions to better reflect prior intuitions.\u003c/p\u003e\n"],["\u003cp\u003eVisualizing the prior distribution before analysis is crucial for ensuring it aligns with expectations and avoids misrepresentation of prior beliefs.\u003c/p\u003e\n"]]],["Meridian uses passing distributions for ROI calibration, informed by prior beliefs and experiments. Before using custom priors, consider: experiment timing, duration, complexity, estimand differences, and population differences. Adjust prior standard deviation based on confidence; strong confidence warrants a smaller standard deviation. Use the `roi_calibration_period` argument in `ModelSpec`. `LogNormal` distributions are common, and sample code transforms experimental mean and standard error to `LogNormal` parameters. For near-zero experimental results, verify that the `LogNormal` distribution aligns with prior beliefs.\n"],null,["# Set custom ROI priors using past experiments\n\nMeridian requires passing distributions for ROI calibration. Although setting\ncustom priors using results from previous experiments is a sound approach,\nthere are many nuances to consider before proceeding. For example:\n\n- **The timing of the experiment in relation to the MMM time window:**\n If the experiment was conducted either before or after the MMM time window,\n the results might not be directly applicable.\n\n- **The duration of the experiment:** An experiment of short duration might\n not effectively capture the long-term effects of the marketing effectiveness.\n\n- **The complexity of the experiment:** If the experiment involved a mixture\n of channels, the results might not provide clear insights into the performance\n of individual channels.\n\n- **Estimand differences:** The estimands used in experiments can differ from\n those used in the MMM. For example, the MMM counterfactual is zero spend,\n whereas some experiments might have a different counterfactual, such as\n reduced spend.\n\n- **Population differences:** The population targeted in the experiment might\n not be the same as the population considered in the MMM.\n\nWe recommend setting the custom priors based on your belief in the\neffectiveness of a channel. A prior belief can be informed by many things,\nincluding experiments or other reliable analyses. Use the strength in that\nprior belief to inform the standard deviation of the prior:\n\n- If you have a strong belief in the effectiveness of a channel,\n you can apply an adjustment factor to the standard deviation of the prior to\n reflect your confidence. For example, suppose you have conducted several\n experiments for a particular channel and all the experiments yielded similar\n ROI point estimates, or you have historical data from previous MMM analyses\n that support the effectiveness of this channel. In this case, you could set a\n smaller standard deviation for the prior so that the distribution won't vary\n widely. This tighter distribution indicates your strong confidence in the\n experimental results.\n\n- Conversely, the experiment might not necessarily translate to the MMM,\n considering some of the nuances listed earlier. In this case, you might choose\n to apply an adjustment factor to standard deviation of the prior distribution.\n For example, you could set a larger standard deviation for the prior,\n depending on your level of skepticism.\n\nYou should consider using the `roi_calibration_period` argument in\n`ModelSpec`. For more information, see\n[Set the ROI calibration period](/meridian/docs/user-guide/configure-model#set-roi-calibration-period).\n\nWhen setting the prior, the `LogNormal` distribution is a common\none to use. The following sample code can be used to transform experiment's\nmean and standard error to the `LogNormal` prior\ndistribution: \n\n import numpy as np\n\n def estimate_lognormal_dist(mean, std):\n \"\"\"Reparameterization of lognormal distribution in terms of its mean and std.\"\"\"\n mu_log = np.log(mean) - 0.5 * np.log((std/mean)**2 + 1)\n std_log = np.sqrt(np.log((std/mean)**2 + 1))\n return [mu_log, std_log]\n\nHowever, if the results from previous experiments are near zero, you should\nconsider whether your prior beliefs are accurately represented by a\nnon-negative distribution, such as the `LogNormal` distribution. We\nhighly recommend plotting the prior distribution to confirm it matches\nyour prior intuitions before proceeding with the analysis. The following\nsample code shows how to get reparameterized `LogNormal`\nparameters, define the distribution, and draw samples from it. \n\n import tensorflow as tf\n import tensorflow_probability as tfp\n\n # Get reparameterized LogNormal distribution parameters\n mu_log, std_log = estimate_lognormal_dist(mean, std)\n mu_log = tf.convert_to_tensor(mu_log, dtype=tf.float32)\n std_log = tf.convert_to_tensor(std_log, dtype=tf.float32)\n # Define the LogNormal distribution\n lognormal_dist = tfp.distributions.LogNormal(mu_log, std_log)\n # Draw 10,000 samples\n lognormal_samples = lognormal_dist.sample(10000).numpy()"]]