新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
ベースラインを評価する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ベースラインとは、すべての介入群変数がベースライン値に設定されている反事実的シナリオで期待される結果のことです。有料メディアとオーガニック メディアの場合、ベースライン値は 0 です。メディア以外の介入群変数の場合、ベースライン値は、観測された変数の最小値(デフォルト)、最大値、またはユーザー指定の浮動小数点数に設定できます。ベースラインを推定することで、有料メディア、オーガニック メディア、その他のメディア以外の介入群を実施しなかった場合にどのような結果になっていたかを把握できます。このような推定は介入群の因果推論に必要であるため、ベースラインを評価することは重要です。
負のベースラインを評価する
結果(収益または KPI、用語集を参照)の値は負になることはできません。したがって、ベースラインが負の場合、介入群効果の因果推論に統計的な誤りがあることを示しています。他の統計モデルと同様にメリディアンでも統計的誤差は想定されています。ただし、ベースラインが極端な負になった場合は、想定外の誤差が発生してます。
モデルの結果でベースラインが極端な負になった場合は明らかに、モデルの設定、モデルの適合に使用されるデータ、または事前分布の調整が必要です(負の、または低いベースラインを緩和するを参照)。このような場合、より正確で信頼性が高い分析情報を提供できるモデルを目指して、より徹底した反復的なモデル開発プロセスが求められます。
メリディアンが統計的かつ確率的なモデルであることを利用して、負のベースラインは確率的な手法で評価できます。具体的には、期間全体で集計されたベースラインが負になる事後確率を考慮します。この確率が高すぎると、モデルの結果に大きな統計誤差が生じる可能性があります。この確率は Analyzer.negative_baseline_probability
メソッドで計算できます。
from meridian.analysis import analyzer
from meridian.model import model
import numpy as np
mmm = model.Meridian(...)
mmm.sample_posterior(...)
a = analyzer.Analyzer(mmm)
posterior_negative_baseline_prob = a.negative_baseline_probability()
別の方法として、チャンネル貢献度グラフなどで、期間全体にわたって集計されたベースラインの点推定を確認することもできます。ただし、メリディアンは統計的かつ確率的なモデルであるため、点推定には大きな不確実性が伴う可能性があることに注意してください。ベースラインの点推定値が負である場合、必ずしもモデルの偏りを示しているわけではありません。この誤差は、偏りまたは分散のどちらからも生じる可能性があります(二乗誤差のバイアス - バリアンス分解を参照)。これは、データの情報量が限られている場合に特に当てはまります(必要なデータ量を参照)。
モデル適合度グラフなどに表示される、値が負に断片的に低下する期間を過度に重視する必要はありません。断片的に発生する特に小さな低下は、統計モデルに固有の軽微な誤差です。
負のベースラインと貢献率
「合計貢献度が観測結果の 100% を超える」(増分結果が観測結果を超える場合に発生)と「負のベースライン」(増分結果が想定結果を超える場合に発生)には、若干の違いがあります。合計想定結果の事後分布は通常、合計観測結果の周囲に非常に密集して分布していますが、想定結果の事前分布は通常、分散が大きく、観測結果を中心としていません。したがって、負のベースラインの事前確率を評価してもあまり意味がありません。そのため、観測結果の貢献度が 100% を超える確率を評価することをおすすめします。
また、モデルが分散の大きい revenue_per_kpi
値を使用している場合、合計想定結果が合計観測結果と異なる場合があります。通常、推定 KPI の合計は、観測された KPI の合計に非常に近くなりますが、revenue_per_kpi
の分散が大きい場合、合計想定結果と合計観測結果に差異が生じる可能性があります。
負のベースライン、または低いベースラインを緩和する
最初のステップとして、介入群の合計貢献度が、合計観測結果の 100% を超える事前確率を計算します。
from meridian.model import model
from meridian.analyzer import analyzer
import numpy as np
mmm = model.Meridian(...)
mmm.sample_prior(1000)
a = analyzer.Analyzer(mmm)
outcome = mmm.kpi
if mmm.revenue_per_kpi is not None:
outcome *= mmm.revenue_per_kpi
total_outcome = np.sum(outcome)
prior_contribution = a.incremental_outcome(use_posterior=False) / total_outcome
total_prior_contribution = np.sum(prior_contribution, -1)
np.mean(total_prior_contribution > 1, (0, 1))
次のステップとして、各介入群の貢献度が 100% を超える事前確率を次の式で計算します。
np.mean(prior_contribution > 1, (0, 1))
これらの事前確率が高すぎると、特にデータの情報量が限られている場合(事後分布が事前分布と同じ場合を参照)は、負のベースラインの問題が発生する可能性があります。事前分布に対する以下の調整点を考慮に入れ、前述の確認項目を使用してカスタム事前分布を再評価します。
- 負のベースラインは、介入群効果に過剰な貢献度が割り当てられていることを意味します。この問題を軽減するには、介入群の合計貢献度が、合計観測結果の 100% を超える事前確率を減らした、介入群効果のカスタム事前分布を設定します(介入群の事前分布のタイプを選択する方法を参照)。特に、カスタムの
contribution
事前分布タイプが適切な場合があります。
- 費用と ROI の両方が高いチャネルは、そのチャネルの結果が 100% を超え、ベースラインが負になる可能性があります。たとえば、結果が収益で、チャンネルの費用が総収益の 20% の場合、ROI が 5.0 であれば、そのチャンネルが収益の 100% を獲得していること(つまり、チャンネルの貢献度が 100%)になります。実際の費用対効果は 5.0 よりはるかに低い可能性があり、これを反映して事前分布 ROI を設定すると、負のベースラインを回避できます。経験則として、チャネルの 90 パーセンタイル ROI 事前分布は、チャネルの貢献度が 100% を超えることを意味するものではありません。
- 有料メディアに過剰な貢献度が割り当てられている場合は、メディア全体の貢献度を踏まえて ROI 事前分布を設定することを検討してください。これにより、メディア全体の貢献度が 100% を超える事前確率が低くなります。詳細については、メディア全体の貢献度の事前分布を設定するをご覧ください。
事前分布の調整に加え、次のような原因も考慮できます。
- 質の高いコントロール変数(メディア施策とレスポンスの両方に影響するコントロール変数)がモデルに十分にない。理にかなう場合は、より有意義なコントロール変数や、人口スケーリング コントロール変数(検索ボリュームなど)を追加することを検討してください。メリディアンは、デフォルトではコントロール変数を人口でスケーリングしません。コントロール変数を人口でスケーリングするには、
ModelSpec
で control_population_scaling_id
を使用します。
- モデルによって時間効果が十分に説明されていない。
knots
を増やすか、より適切なノットの位置を選択することを検討してください。
傾向と季節性のベースラインを評価する
モデル適合性チャートなどに表示されるベースライン期間が、ベース需要の予想トレンドと季節性に一致しているかどうかを評価します。ベースラインが予想期間中の傾向や季節性を捉えていない場合、その期間の周辺のノットをさらに選択すること(ノットの位置を指定するリストに knots
を設定することで)を検討してください。また、ベース需要の傾向や季節性を説明できるコントロール変数も検討します(コントロール変数を参照)。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-09 UTC。
[null,null,["最終更新日 2025-09-09 UTC。"],[],["The baseline, representing the expected outcome without treatments, should not be negative, as negativity indicates statistical error. An extremely negative baseline signals the need to adjust model settings, data, or priors. Evaluate the probability of a negative baseline probabilistically, and check the prior probability of negative baselines and treatments exceeding 100% contribution. Mitigation strategies involve adjusting treatment effect priors, setting realistic ROI priors, adding controls, and refining time effect modeling via knots. Additionally it is important to check the baseline for appropriate trends and seasonality.\n"],null,["The baseline is the expected outcome in the counterfactual scenario where all\ntreatment variables are set to their baseline values. For paid and organic\nmedia, the baseline values are zero. For non-media treatment variables, the\nbaseline value can be set to the observed minimum value of the variable\n(default), the maximum, or a user-provided float. Estimating the baseline allows\none to understand what would have happened if they did not engage in paid media,\norganic media, or other non-media treatments. It is necessary for the causal\ninference of the treatments, and thus, it is important to assess the baseline.\n\nAssess the baseline for negativity\n\nThe outcome (either revenue or the KPI, see\n[Glossary](/meridian/docs/basics/glossary)) cannot be negative. Therefore, a\nnegative baseline indicates statistical error in the causal inference of the\ntreatment effects. Like all statistical models, we expect some statistical error\nin Meridian. However, an extremely negative baseline indicates extreme\nerror.\n\nA model result with an extremely negative baseline reveals that the model needs\nadjustment. This provides a clear signal that model settings, data used to fit\nthe model, or priors ought to be adjusted (see\n[Mitigate negative or low baseline](/meridian/docs/advanced-modeling/baseline#mitigate-negative-baseline)).\nThis compels a more thorough and iterative model development process, ultimately\nleading to a more accurate, reliable, and insightful model.\n\nMeridian is a statistical and probabilistic model. We recommend taking\nadvantage of this by assessing the negativity of the baseline probabilistically.\nSpecifically, consider the posterior probability that the baseline aggregated\nover the entire time window is negative. If this probability is too high, then\nthe model result may have large statistical error. You can calculate\nthis probability with the\n[`Analyzer.negative_baseline_probability`](/meridian/reference/api/meridian/analyzer/Analyzer#negative_baseline_probability)\nmethod: \n\n from meridian.analysis import analyzer\n from meridian.model import model\n import numpy as np\n\n mmm = model.Meridian(...)\n mmm.sample_posterior(...)\n a = analyzer.Analyzer(mmm)\n posterior_negative_baseline_prob = a.negative_baseline_probability()\n\nAlternatively, one could examine the point estimate of the baseline aggregated\nover the entire time window, as in [Channel contribution charts](/meridian/docs/advanced-modeling/interpret-visualizations#channel_contribution_charts).\nHowever, remember that Meridian is a statistical and probabilistic\nmodel, and a point estimate can have significant uncertainty. A negative\nbaseline point estimate does not necessarily indicate model bias. It indicates\nerror, which can stem from either bias or variance (see [Bias--variance\ndecomposition of mean squared error](https://en.wikipedia.org/wiki/Bias%E2%80%93variance_tradeoff#Bias%E2%80%93variance_decomposition_of_mean_squared_error)).\nThis is especially true when the data contains limited information (see\n[Amount of data needed](/meridian/docs/advanced-modeling/amount-data-needed)).\n\nWe advise against overemphasizing a baseline time series, such as the one in\n[Model fit charts](/meridian/docs/advanced-modeling/interpret-visualizations#model_fit_charts),\nthat occasionally dips into negative values. An occasional, especially small,\ndip indicates minor error, which is inherent in any statistical model.\n\nNegative baseline versus contribution percentage\n\nThere is a subtle difference between \"total contribution exceeding\n100% of observed outcome\" (which occurs if incremental outcome exceeds\n**observed** outcome) and \"negative baseline\" (which occurs if incremental\noutcome exceeds **expected** outcome). The posterior distribution of total\nexpected outcome is usually very closely distributed around the total observed\noutcome, but the prior distribution of expected outcome typically has large\nvariance and is not centered around the observed outcome. Consequently, it does\nnot make much sense to evaluate the prior probability of negative baseline,\nwhich is why we advise evaluating the probability that contribution exceeds 100%\nof observed outcome instead.\n\nAlso note that the total expected outcome may differ from the total observed\noutcome if your model uses `revenue_per_kpi` values with high variance.\nTypically the total expected KPI will be very close to the total observed KPI,\nbut high variance in `revenue_per_kpi` can create a discrepancy between total\nexpected outcome and total observed outcome.\n\nMitigate negative or low baseline\n\nAs a first step, calculate the prior probability that the total treatment\ncontribution exceeds 100% of total observed outcome: \n\n from meridian.model import model\n from meridian.analyzer import analyzer\n import numpy as np\n\n mmm = model.Meridian(...)\n mmm.sample_prior(1000)\n a = analyzer.Analyzer(mmm)\n outcome = mmm.kpi\n if mmm.revenue_per_kpi is not None:\n outcome *= mmm.revenue_per_kpi\n total_outcome = np.sum(outcome)\n prior_contribution = a.incremental_outcome(use_posterior=False) / total_outcome\n total_prior_contribution = np.sum(prior_contribution, -1)\n np.mean(total_prior_contribution \u003e 1, (0, 1))\n\nAs a next step, calculate the prior probability that each individual treatment's\ncontribution exceeds 100%: \n\n np.mean(prior_contribution \u003e 1, (0, 1))\n\nIf these prior probabilities are too high, particularly when the data contains\nlimited information (see [When the posterior is the same as the prior](/meridian/docs/advanced-modeling/model-debugging#posterior-same-as-prior)),\na negative baseline problem may arise. Consider these adjustments to the prior\nand then reevaluate the custom priors using the checks described earlier:\n\n- Negative baseline is equivalent to the treatment effects getting too much credit. To mitigate this, set custom priors for the treatment effects (see [How to choose treatment prior types](/meridian/docs/advanced-modeling/how-to-choose-treatment-prior-types)) that reduce the prior probability that the total treatment contribution exceeds 100% of total observed outcome. In particular, a custom `contribution` prior type may be appropriate.\n- A channel with both high spend and high ROI might suggest that the channel drives more than 100% of the outcome, resulting in a negative baseline. For example, if your outcome is revenue and a channel's spend is 20% of total revenue, an ROI of 5.0 would indicate that the channel drives 100% of revenue (i.e., the channel's contribution is 100%). The actual ROI is likely much lower than 5.0, and setting a prior ROI to reflect this can help prevent a negative baseline. As a rule of thumb, the 90th percentile ROI prior for a channel shouldn't imply that the channel's contribution is over 100%.\n- If paid media is getting too much credit, consider setting the ROI prior in terms of total media contribution, so that the total media contribution has low prior probability of being larger than 100%. For more information, see [Set the total media contribution prior](/meridian/docs/advanced-modeling/unknown-revenue-kpi-custom#set-total-paid-media-contribution-prior).\n\nIn addition to adjusting the prior, there are a few other possible causes to\ninvestigate:\n\n- The model doesn't have enough high-quality controls, meaning controls that have an affect on both media execution and the response. Consider adding more meaningful controls or population scaling controls where it makes sense to do, such as query volume. Meridian does not population scale control variables by default. To population scale control variables, use `control_population_scaling_id` in `ModelSpec`.\n- The model is not sufficiently explaining time effects. Consider increasing `knots` or selecting more appropriate knot locations.\n\nAssess the baseline for trend and seasonality\n\nAssess whether the baseline time series, such as the one in\n[Model fit charts](/meridian/docs/advanced-modeling/interpret-visualizations#model_fit_charts),\nmatches the expected trend and seasonality of base demand. If the baseline fails\nto capture trend or seasonality during expected time periods, consider selecting\nmore knots around those periods. This can be achieved by setting `knots` to a\nlist, which specifies knot locations. Additionally, consider control variables\nthat could explain the trend or seasonality in the base demand (see\n[Control variables](/meridian/docs/advanced-modeling/control-variables))."]]