新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
因果グラフ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
前提要件では、バックドア条件を満たす因果グラフを仮定にすると、条件付き交換可能性の仮定が成り立つと述べました。
因果グラフは、変数間の関係を示します。変数はコレクション(ノード)にグループ化され、ノード間の矢印は、その矢印の方向に因果関係が存在する可能性があることを意味します。矢印によって、すべての変数ペアの間に因果関係が存在することが示されるわけではありませんが、どの変数ペアの場合でも、逆方向の因果関係は存在できないことを示しています。
バックドア基準(Pearl, J.、2009 年)では、因果図が与えられた場合に、次の両方が真であれば、変数セット \(Z\) は介入群変数 \(X\) と応答変数 \(Y\) に対するバックドア基準を満たすと述べています。
- \(Z\) 内のノードがいずれも \(X\)の子孫ではなく、かつ
- \(Z\) によって、 \(X\)への矢印を含む \(X\) と \(Y\) 間のすべてのパスがブロックされる
マーケティング ミックス モデリング(MMM)は、有料メディア、オーガニック メディア、メディア以外の変数が KPI(売上など)に及ぼす因果効果を推定するために使用されます。つまり、有料メディア、オーガニック メディア、メディア以外の変数は介入群変数(\(X\))であり、KPI は応答変数(\(Y\))です。MMM 回帰からこの因果効果を推定するには、バックドア基準を満たす一連のコントロール変数を慎重に選択して、条件を設定する必要があります。バックドア基準は次のように言い換えることができます。
- メディエーターを制御してはならない。メディエーターは、 \(X\) と \(Y\)の間の因果経路にある変数です。
- すべての交絡因子を制御する必要がある。交絡因子は、 \(X\) と \(Y\)の両方に因果効果を持つ変数です。
MMM のトリートメント変数は、地域と時間の両方でインデックスに登録された有料メディア、オーガニック メディア、メディア以外のトリートメント変数の、任意の組み合わせのコレクションです。トリートメント全体をグラフに表すと扱いにくいため、1 つの地域内の 2 つの期間のみを表す、簡略化したグラフについて考えてみましょう。地域は独立しているという前提になっているため、同じグラフを使用して任意の地域を表すことができます。また、地域間に矢印や関係性はありません。2 つの期間で、遅延トリートメント効果のパターンを十分に説明できます。このパターンは、将来にわたって(または最大遅延時間まで)無制限に繰り返されると想定できます。
下図で、 \(T\) は有料メディア、オーガニック メディア、メディア以外のトリートメント変数、 \(C\) はコントロール、 \(K\) は KPI を表しています。各変数に続く数値は期間を表します。各期間内で、介入群が売上に影響し、コントロールが介入群と売上の両方に影響すると仮定します。次の図では、前の期間の \(T\) が現在の期間の売上に影響しています(「遅延効果」)。メリディアン回帰モデルでは、有料メディアとオーガニック メディアに adstock が適用されますが、メディア以外の介入群には適用されません。これは、実質的には、メディア以外の介入群には遅延効果がないことを前提としています。接続されたノード内の任意の変数ペアの間に因果効果が存在する可能性があることを矢印は示しているため、ノード \(T\) にメディア以外の介入群を含めることは引き続き有効です。ノード \(T\) にメディア以外の介入群を含めると、DAG の表示がクリーンになります。DAG は、バックドア基準を満たす変数を決定するために引き続き有効です。
期間 2(\(K2\))の KPI に対する介入群(\(T1\) と\(T2\))の因果効果を推定するというタスクを考えてみましょう。グラフから、期間 2 のコントロール(\(C2\))がバックドア基準を満たしていることがわかります。
軸になる結論は、各期間で、MMM 回帰によって次に対して条件を設定する必要があるということなります。
- 現在の期間の有料メディアとオーガニック メディア、および想定される最大遅延時間までのすべての前の期間のメディア。
- 現在の期間のみの、メディア以外のトリートメント変数。
- 現在の期間のみのコントロール変数。
留意すべき点は次のとおりです。
- \(C1\) から \(C2\) への矢印は、回帰に含める変数には影響しません。
- \(C1\) から \(K2\) への矢印の場合は、回帰に遅延ありのコントロール変数を含める必要があります。実際には、回帰パラメータの数が大幅に増える可能性があるため、可能であればこれは避けた方が賢明です。
- \(T1\) から \(C2\) への矢印の場合は問題があります。この場合、 \(C2\) はメディエーターと交絡因子の両方を兼ねます。1 つの MMM 回帰モデルで、因果的な合同介入群効果を復元することはできません。
- パスの \(T2 \leftarrow K1 \rightarrow K2\) を追加しても、同じ理由で問題になります。その場合、 \(K1\) はメディエーターと交絡因子の両方を兼ねます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-04 UTC。
[null,null,["最終更新日 2025-08-04 UTC。"],[[["\u003cp\u003eCausal relationships between variables are represented in a causal graph where nodes represent variables and arrows indicate potential causal effects.\u003c/p\u003e\n"],["\u003cp\u003eThe backdoor criterion is used to identify a set of control variables (Z) that allow for the estimation of the causal effect of treatment variables (X) on a response variable (Y).\u003c/p\u003e\n"],["\u003cp\u003eMarketing Mix Modeling (MMM) aims to estimate the causal effects of marketing activities on a key performance indicator (KPI) by applying the backdoor criterion.\u003c/p\u003e\n"],["\u003cp\u003eIn MMM, it's crucial to control for confounders (variables affecting both treatment and KPI) and avoid controlling for mediators (variables in the causal pathway between treatment and KPI).\u003c/p\u003e\n"],["\u003cp\u003eThe MMM regression should include current and lagged paid/organic media, current non-media treatments, and current control variables to estimate causal effects accurately.\u003c/p\u003e\n"]]],["Causal graphs depict variable relationships, where arrows indicate potential causal effects. The backdoor criterion, essential for causal effect estimation, requires controlling for confounders (variables affecting both treatment and outcome) while excluding mediators (variables in the causal pathway). Marketing mix modeling (MMM) uses this to estimate treatment effects (media) on a KPI. MMM regressions should include: current and lagged paid/organic media, current non-media, and current control variables. Lagged controls, or cases where control or outcome variables are both a mediator and a confounder should be avoided.\n"],null,["# Causal graph\n\nIn [Required assumptions](/meridian/docs/basics/required-assumptions), it was\nstated that conditional exchangeability assumption holds if you assume a causal\ngraph that meets the backdoor criterion.\n\nA causal graph shows the relationship between variables. Variables are grouped\ninto collections (nodes), and an arrow between nodes indicates that a causal\neffect might exist in the direction of an arrow. An arrow does not necessarily\nindicate that a causal relationship exists between every pair of variables, but\nit does indicate that a causal relationship cannot exist in the reverse\ndirection for any pair of variables.\n\nThe *backdoor criterion* (Pearl, J., 2009) states that given a causal diagram, a\nset of variables \\\\(Z\\\\) satisfies the backdoor criterion relative to a\ntreatment variable \\\\(X\\\\) and the response variable \\\\(Y\\\\) if *both* of the\nfollowing are true:\n\n- No node in \\\\(Z\\\\) is a descendant of \\\\(X\\\\), and\n- \\\\(Z\\\\) blocks every path between \\\\(X\\\\) and \\\\(Y\\\\) that contains an arrow into \\\\(X\\\\)\n\nMarketing mix modeling (MMM) is used to estimate the causal effect of paid\nmedia, organic media, and non-media variables on a KPI (such as sales). So paid\nmedia, organic media, and non-media are the treatment variables (\\\\(X\\\\)) and\nthe KPI is the response variable (\\\\(Y\\\\)). To estimate this causal effect from\nan MMM regression, the MMM must condition on a carefully selected set of control\nvariables that meets the backdoor criterion. To paraphrase the backdoor\ncriterion conditions:\n\n- You must *not* control for any mediators. *Mediators* are variables that lie in the causal pathway between \\\\(X\\\\) and \\\\(Y\\\\).\n- You must control for all confounders. *Confounders* are variables that have a causal effect on both \\\\(X\\\\) and \\\\(Y\\\\).\n\nThe MMM treatment variable is a collection of any combination of paid media,\norganic media, and non-media treatment variables indexed over both geo and time.\nIt is is unwieldy to represent the entire treatment in a graph, so consider a\nsimplified graph that represents only two time periods within a single geo. Geos\nare assumed to be independent, so the same graph can be used to represent any\ngeo, and there are no arrows or relationships between geos. Two time periods are\nenough to describe the pattern of lagged treatment effects, which you can assume\nis repeated indefinitely into the future (or up to some maximum lag duration).\n\nIn the following diagram, \\\\(T\\\\) denotes paid media, organic media, and\nnon-media treatment variables, \\\\(C\\\\) denotes controls, and \\\\(K\\\\) denotes the\nKPI. The number following each variable denotes the time period. Within each\ntime period, assume that treatment affects sales, and that controls affect both\ntreatment and sales. In the following diagram, \\\\(T\\\\) from a previous time\nperiod affects sales in the current time period (\"lagged effect\"). The\nMeridian regression model applies adstock to paid and organic media, but\nnot to non-media treatments. This effectively assumes that non-media treatments\ndon't have lagged effects. Including non-media treatments in node \\\\(T\\\\) is\nstill valid because an arrow indicates that a causal effect **may** exist\nbetween any pair of variables in connected nodes. Including non-media treatments\nin node \\\\(T\\\\) makes the DAG presentation cleaner, and the DAG is still valid\nfor determining which variables satisfy the backdoor criterion.\n\nConsider the task of estimating the causal effect of treatment (\\\\(T1\\\\) and\n\\\\(T2\\\\)) on the KPI for time period 2 (\\\\(K2\\\\)). From the graph, you can see\nthat the time 2 controls (\\\\(C2\\\\)) satisfies the backdoor criterion.\n\nThe main conclusions are that for each time period, the MMM regression should\ncondition on:\n\n1. Paid and organic media from the current time period and all preceding time periods, up to an assumed maximum lag duration.\n2. Non-media treatment variables of the current time period only.\n3. Control variables of the current time period only.\n\nA few noteworthy details to consider are:\n\n- An arrow from \\\\(C1\\\\) to \\\\(C2\\\\) has no implication on which variables to include in the regression.\n- An arrow from \\\\(C1\\\\) to \\\\(K2\\\\) requires the regression to include lagged control variables. In practice, it is best to avoid this if at all possible, as it could significantly increase the number of regression parameters.\n- An arrow from \\\\(T1\\\\) to \\\\(C2\\\\) is problematic. In this case, \\\\(C2\\\\) is both a mediator and a confounder. A single MMM regression model cannot be used to recover the causal joint treatment effect.\n- Adding the path \\\\(T2 \\\\leftarrow K1 \\\\rightarrow K2\\\\) is problematic for the same reason. In this case, \\\\(K1\\\\) acts as both a mediator and confounder."]]