|
| 1 | +\documentclass{standalone} |
| 2 | + |
| 3 | +\usepackage{tikz} |
| 4 | +\usetikzlibrary{arrows,positioning,shapes,calc,fit,overlay-beamer-styles} |
| 5 | + |
| 6 | +\usepackage{dsfont,pifont} |
| 7 | +\newcommand*{\expe}{\mathds{E}} |
| 8 | +\usepackage{amsmath} |
| 9 | +\usepackage{booktabs} |
| 10 | + |
| 11 | +\usepackage[default]{FiraSans} |
| 12 | +\usepackage[mathrm=sym]{unicode-math} |
| 13 | +\setmathfont{Fira Math} |
| 14 | + |
| 15 | +\begin{document} |
| 16 | +\tikzset{ |
| 17 | + node/.style={circle, draw, minimum size=3ex, inner sep=0.2}, |
| 18 | + edge/.style={->,> = latex'}, |
| 19 | +} |
| 20 | + |
| 21 | +\newcommand{\cmark}{\ding{51}}% |
| 22 | +\newcommand{\xmark}{\ding{55}}% |
| 23 | + |
| 24 | +\begin{tikzpicture} |
| 25 | + \scriptsize |
| 26 | + |
| 27 | + \begin{scope}[name prefix=scenario-, local bounding box=specification] |
| 28 | + % Causal DAG |
| 29 | + \begin{scope}[name prefix=dag-] |
| 30 | + \node[node] (x1) at (0,0) {$X_2$}; |
| 31 | + \node[node] (x2) at (0,1) {$X_1$}; |
| 32 | + \node[node] (i) at (0.5,0.5) {$I$}; |
| 33 | + \node[node] (y1) at (1.2,0) {$Y_1$}; |
| 34 | + \node[node] (y2) at (1.2,0.5) {$Y_2$}; |
| 35 | + \node[node] (y3) at (1.2,1) {$Y_3$}; |
| 36 | + |
| 37 | + \draw[edge] (x1) to (i); |
| 38 | + \draw[edge] (x2) to (i); |
| 39 | + \draw[edge] (i) to (y1); |
| 40 | + \draw[edge] (i) to (y2); |
| 41 | + \draw[edge] (i) to (y3); |
| 42 | + \draw[edge] (x1) to (y1); |
| 43 | + \draw[edge] (x2) to (y3); |
| 44 | + \node[draw=none, rectangle] (nodes) [fit=(x1) (x2) (y1) (y2) (y3) (i)] {}; |
| 45 | + \node[draw=none, rectangle, anchor=south] (title) at (nodes.north) {Causal DAG}; |
| 46 | + \end{scope} |
| 47 | + \node[draw, rectangle] (dag) [fit=(dag-nodes) (dag-title)] {}; |
| 48 | + |
| 49 | + \begin{scope}[name prefix=scenario-, shift={($(dag.east |- dag-title.north)+(0.3, 0)$)}, anchor=north west] |
| 50 | + \node[draw=none, rectangle] (title) at (0, 0) {Modelling Scenario}; |
| 51 | + \node[anchor=north] (constraints) at (title.south) {$\{ x_1 < 5, x_2 = \text{``UK''} \}$}; |
| 52 | + \end{scope} |
| 53 | + \node[draw, rectangle] (scenario) [fit=(scenario-title) (scenario-constraints)] {}; |
| 54 | + |
| 55 | + \node[draw=none, rectangle] (scenario) [fit=(dag) (scenario)] {}; |
| 56 | + \node[draw=none, rectangle, anchor=south] (title) at (scenario.north) {Causal Specification}; |
| 57 | + \end{scope} |
| 58 | + \node[draw, rectangle] [fit=(scenario-scenario) (scenario-title)] {}; |
| 59 | + |
| 60 | + \begin{scope}[name prefix=test-, local bounding box=test-case, shift={($(specification.south)+(0, -1)$)}] |
| 61 | + \node[draw=none, rectangle, anchor=north] (title) at (0, 0) {Causal Test Case}; |
| 62 | + \node[anchor=north] (tuple) at (title.south) {$(X=i, \Delta=\text{increase}, Y=y_1)$}; |
| 63 | + \coordinate (left) at (scenario-scenario.east |- {(0, 0)}); |
| 64 | + \coordinate (right) at (scenario-scenario.west |- {(0, 0)}); |
| 65 | + \node[draw, rectangle] [fit=(title) (tuple) (left) (right)] {}; |
| 66 | + \end{scope} |
| 67 | + |
| 68 | + \begin{scope}[name prefix=estimand-, local bounding box=estimand, anchor=south, shift={($(test-case.east |- test-tuple.south) + (1, 0)$)}] |
| 69 | + \node[anchor=south west] (eqn) at (0,0) { |
| 70 | + $\Delta Y=\expe{[I=0 | X_1]} - \expe{[I=1 | X_1]} $ |
| 71 | + }; |
| 72 | + \node[draw=none, rectangle, anchor=south] (title) at (eqn.north) {Statistical Estimand}; |
| 73 | + \node[draw, rectangle] [fit=(estimand-title) (estimand-eqn)] {}; |
| 74 | + \end{scope} |
| 75 | + |
| 76 | + \begin{scope}[name prefix=estimate-, local bounding box=estimate, shift={($(estimand.east)+(1, 0)$)}] |
| 77 | + \node[draw=none, rectangle, anchor=south west] (title) at (0, 0) {Causal Estimate}; |
| 78 | + \node[anchor=north] (table) at (title.south) { |
| 79 | + $\Delta Y=5$ |
| 80 | + }; |
| 81 | + \coordinate (top) at ({(0, 0)} |- test-title.north); |
| 82 | + \coordinate (bot) at ({(0, 0)} |- estimand-eqn.south); |
| 83 | + \node[draw, rectangle] [fit=(title) (table) (top) (bot)] {}; |
| 84 | + \end{scope} |
| 85 | + |
| 86 | + \begin{scope}[name prefix=data-, local bounding box=test-data, shift={($(estimate.north)+(0, 1)$)},] |
| 87 | + \node[draw=none, rectangle] (title) at (estimate |- scenario-title) {Test Data}; |
| 88 | + \node[anchor=north] (table) at (title.south) { |
| 89 | + \begin{tabular}{rrrrrr} |
| 90 | + \toprule |
| 91 | + $X_1$ & $X_2$ & $I$ & $Y_1$ & $Y_2$ & $Y_3$ \\ |
| 92 | + \midrule |
| 93 | + 1.2 & ``UK'' & 0.3 & 7.8 & 4 & 100 \\ |
| 94 | + 3.2 & ``UK'' & 0.1 & 7.6 & 8 & 95 \\ |
| 95 | + \multicolumn{6}{c}{$\vdots$} \\ |
| 96 | + \bottomrule |
| 97 | + \end{tabular} |
| 98 | + }; |
| 99 | + \node[draw, rectangle] [fit=(title) (table)] {}; |
| 100 | + \end{scope} |
| 101 | + |
| 102 | + \begin{scope}[name prefix=oracle-, local bounding box=test-oracle, shift={($(estimate.east) + (1.54, -0.4)$)}] |
| 103 | + \begin{scope}[shift={(0,0)}, local bounding box=brain, scale=1.2] |
| 104 | + \begin{scope}[shift={(-7.6932,3.5256)}, local bounding box=brain] |
| 105 | + \path[draw,line width=0.025cm] (8.162, -2.8955) circle (0.066cm); |
| 106 | + \path[draw,line width=0.025cm] (8.0485, -3.2243) circle (0.066cm); |
| 107 | + \path[draw,line width=0.025cm] (8.0346, -3.5296) circle (0.066cm); |
| 108 | + \path[draw,line width=0.025cm] (8.2166, -3.757) circle (0.066cm); |
| 109 | + \path[draw,line width=0.025cm] (7.6556, -3.7827) circle (0.066cm); |
| 110 | + \path[draw,line width=0.025cm] (7.6315, -3.5091) circle (0.066cm); |
| 111 | + \path[draw,line width=0.025cm] (7.4451, -3.2224) circle (0.066cm); |
| 112 | + \path[draw,line width=0.025cm] (7.6247, -2.9461) circle (0.066cm); |
| 113 | + |
| 114 | + \path[draw,line width=0.025cm,miter limit=4.0] (7.6932, -2.6331) -- (7.3637, -2.8234) -- (7.3637, -3.0567) -- (7.1749, -3.1656) -- (7.1749, -3.5256) -- (7.3341, -3.6175) -- (7.3341, -3.8517) -- (7.6883, -4.0562) -- (7.868, -3.9669) -- (8.0478, -4.0562) -- (8.4019, -3.8517) -- (8.4019, -3.6175) -- (8.5611, -3.5256) -- (8.5611, -3.1656) -- (8.3724, -3.0567) -- (8.3724, -2.8234) -- (8.0429, -2.6331) -- (7.868, -2.7341) -- cycle; |
| 115 | + \path[draw,line width=0.025cm,miter limit=4.0] (7.868, -3.9669) -- (7.868, -2.7341); |
| 116 | + \path[draw,line width=0.025cm] (7.5588, -2.9461) -- (7.3637, -2.9461); |
| 117 | + \path[draw,line width=0.025cm] (7.4451, -3.1565) -- (7.4451, -2.9461); |
| 118 | + \path[draw,line width=0.025cm] (7.6316, -3.4431) -- (7.6316, -3.2116) -- (7.868, -3.2116); |
| 119 | + \path[draw,line width=0.025cm] (7.5897, -3.7827) -- (7.4177, -3.7827) -- (7.4177, -3.523) -- (7.1749, -3.523); |
| 120 | + \path[draw,line width=0.025cm] (8.162, -2.9614) -- (8.162, -3.0534) -- (7.868, -3.0534); |
| 121 | + \path[draw,line width=0.025cm] (8.0485, -3.1584) -- (8.0485, -3.0534); |
| 122 | + \path[draw,line width=0.025cm] (8.1005, -3.5296) -- (8.313, -3.5296) -- (8.313, -3.3442) -- (8.5611, -3.3442); |
| 123 | + \path[draw,line width=0.025cm] (8.1507, -3.757) -- (8.0477, -3.757) -- (8.0477, -4.0561); |
| 124 | + \end{scope} |
| 125 | + \end{scope} |
| 126 | + \node[draw=none, rectangle, anchor=south] (title) at (brain.north) {Test Oracle}; |
| 127 | + |
| 128 | + \node[draw, rectangle] [fit=(title) (brain)] {}; |
| 129 | + \end{scope} |
| 130 | + |
| 131 | + \begin{scope}[name prefix=outcome-, local bounding box=test-outcome, shift={($(brain.east |- estimate.east) + (1, 0)$)}] |
| 132 | + \node[draw=none, rectangle, anchor=south west] (title) at (0,0) {Test Outcomes}; |
| 133 | + \node[draw=none, anchor=north] (ok) at (title.south) {\cmark ~ \xmark}; |
| 134 | + |
| 135 | + \coordinate (top) at ({(0, 0)} |- test-title.north); |
| 136 | + \coordinate (bot) at ({(0, 0)} |- estimand-eqn.south); |
| 137 | + \node[draw, rectangle] (test-outcome) [fit=(outcome-title) (outcome-ok) (top) (bot)] {}; |
| 138 | + \end{scope} |
| 139 | + |
| 140 | + \draw[edge, dashed] ($(specification.east) + (0.1, 0)$) -- (estimand.north |- specification.east) -- (estimand.north); |
| 141 | + \draw[edge, dashed] (test-case) -- (estimand); |
| 142 | + |
| 143 | + \draw[edge, dashed] (test-data.south) -- (estimate.north); |
| 144 | + \draw[edge, dashed] (estimand) -- (estimate); |
| 145 | + |
| 146 | + \draw[edge, dashed] (estimate) -- (test-oracle.west |- estimate); |
| 147 | + \draw[edge, dashed] (test-oracle.east |- test-outcome) -- (test-outcome); |
| 148 | +\end{tikzpicture} |
| 149 | +\end{document} |
0 commit comments