|
| 1 | +\documentclass{standalone} |
| 2 | + |
| 3 | +\usepackage{tikz} |
| 4 | +\usetikzlibrary{arrows,positioning,shapes,calc,fit,overlay-beamer-styles, backgrounds} |
| 5 | +\usepackage{dsfont,pifont} |
| 6 | +\newcommand*{\expe}{\mathds{E}} |
| 7 | +\usepackage{amsmath} |
| 8 | +\usepackage{booktabs} |
| 9 | +\usepackage{fontawesome7} |
| 10 | + |
| 11 | +\usepackage[default]{FiraSans} |
| 12 | +\usepackage[mathrm=sym]{unicode-math} |
| 13 | +\setmathfont{Fira Math} |
| 14 | + |
| 15 | +\newcommand{\indep}{\perp \!\!\! \perp} |
| 16 | + |
| 17 | +\begin{document} |
| 18 | +\tikzset{ |
| 19 | + node/.style={circle, draw, minimum size=3ex, inner sep=0.2}, |
| 20 | + edge/.style={->,> = latex'}, |
| 21 | +} |
| 22 | + |
| 23 | +\newcommand{\cmark}{\ding{51}}% |
| 24 | +\newcommand{\xmark}{\ding{55}}% |
| 25 | + |
| 26 | +\begin{tikzpicture}[background rectangle/.style={fill=none}, show background rectangle, color=black] |
| 27 | + |
| 28 | + % Test Case |
| 29 | + \begin{scope}[name prefix=test-, local bounding box=test-case] |
| 30 | + \node[draw=none, rectangle, anchor=north] (title) at (0, 0) {Causal Test Cases}; |
| 31 | + \node[anchor=north,align=center] (tuple) at (title.south) {$I \to_{?} Y_3$\hspace{5mm}$X_2 \indep_? X_2$}; |
| 32 | + \node[draw, rectangle] [fit=(title) (tuple)] {}; |
| 33 | + \end{scope} |
| 34 | + |
| 35 | + % ci |
| 36 | + \begin{scope}[name prefix=ci-, local bounding box=ci, shift={($(test-test-case.east) + (1, 0)$)}] |
| 37 | + \node[draw=none, rectangle, anchor=south west] (title) {Causal Inference}; |
| 38 | + \node[draw=none, rectangle, anchor=north, align=center] (brain) at (title.south) {\faIcon{hexagon-nodes-bolt}}; |
| 39 | + |
| 40 | + \coordinate (top) at ({(0, 0)} |- test-title.north); |
| 41 | + \coordinate (bot) at ({(0, 0)} |- test-tuple.south); |
| 42 | + |
| 43 | + \node[draw, rectangle] [fit=(title) (brain) (top) (bot)] {}; |
| 44 | + \end{scope} |
| 45 | + |
| 46 | + % Estimate |
| 47 | + \begin{scope}[name prefix=estimate-, local bounding box=estimate, shift={($(ci-ci.east)+(1, 0)$)}] |
| 48 | + \node[draw=none, rectangle, anchor=south west] (title) {Causal Estimate}; |
| 49 | + \node[anchor=north] (table) at (title.south) {\faIcon{chart-line}}; |
| 50 | + \coordinate (top) at ({(0, 0)} |- test-title.north); |
| 51 | + \coordinate (bot) at ({(0, 0)} |- test-tuple.south); |
| 52 | + \node[draw, rectangle] [fit=(title) (table) (top) (bot)] {}; |
| 53 | + \end{scope} |
| 54 | + |
| 55 | + % Oracle |
| 56 | + \begin{scope}[name prefix=oracle-, local bounding box=test-oracle, shift={($(estimate-estimate.east) + (1, 0)$)}] |
| 57 | + \node[draw=none, rectangle, anchor=south west] (title) {Test Oracle}; |
| 58 | + \node[draw=none, rectangle, anchor=north] (scale) at (title.south) {\faIcon{scale-balanced}}; |
| 59 | + |
| 60 | + \coordinate (top) at ({(0, 0)} |- test-title.north); |
| 61 | + \coordinate (bot) at ({(0, 0)} |- test-tuple.south); |
| 62 | + \node[draw, rectangle] [fit=(title) (scale) (top) (bot)] {}; |
| 63 | + \end{scope} |
| 64 | + |
| 65 | + % Outcome |
| 66 | + \begin{scope}[name prefix=outcome-, local bounding box=test-outcome, shift={($(oracle-test-oracle.east) + (1, 0)$)}] |
| 67 | + \node[draw=none, rectangle, anchor=south west] (title) at (0,0) {Test Outcomes}; |
| 68 | + \node[draw=none, anchor=north] (ok) at (title.south) {\cmark ~ \xmark}; |
| 69 | + |
| 70 | + \coordinate (top) at ({(0, 0)} |- test-title.north); |
| 71 | + \coordinate (bot) at ({(0, 0)} |- test-tuple.south); |
| 72 | + \node[draw, rectangle] (test-outcome) [fit=(outcome-title) (outcome-ok) (top) (bot)] {}; |
| 73 | + \end{scope} |
| 74 | + |
| 75 | + |
| 76 | + % Causal DAG |
| 77 | + \begin{scope}[name prefix=dag-, shift={(0, 2)}] |
| 78 | + \node[node] (x1) at (-1, 0) {$X_1$}; |
| 79 | + \node[node] (x2) at (-1, 1.4) {$X_2$}; |
| 80 | + \node[node] (i) at (0, 0.7) {$I$}; |
| 81 | + \node[node] (y1) at (1,0) {$Y_{1}$}; |
| 82 | + \node[node] (y2) at (1,0.7) {$Y_2$}; |
| 83 | + \node[node] (y3) at (1,1.4) {$Y_3$}; |
| 84 | + |
| 85 | + \draw[edge] (x1) to (i); |
| 86 | + \draw[edge] (x2) to (i); |
| 87 | + \draw[edge] (i) to (y1); |
| 88 | + \draw[edge] (i) to (y2); |
| 89 | + \draw[edge] (i) to (y3); |
| 90 | + \draw[edge] (x1) to (y1); |
| 91 | + \draw[edge] (x2) to (y3); |
| 92 | + \node[draw=none, rectangle] (nodes) [fit=(x1) (x2) (y1) (y2) (y3) (i)] {}; |
| 93 | + \node[draw=none, rectangle, anchor=south] (title) at (nodes.north) {Causal DAG}; |
| 94 | + \end{scope} |
| 95 | + % DAG outline |
| 96 | + \node[draw, rectangle] (dag) [fit=(dag-nodes) (dag-title) (dag-title)] {}; |
| 97 | + |
| 98 | + % Data |
| 99 | + \begin{scope}[name prefix=data-, local bounding box=test-data, shift={($(dag) + (5, 1.12)$)}] |
| 100 | + \node[draw=none, rectangle] (title) {Test Data}; |
| 101 | + \node[anchor=north] (table) at (title.south) { |
| 102 | + \begin{tabular}{rrrrrr} |
| 103 | + \toprule |
| 104 | + $X_1$ & $X_2$ & $I$ & $Y_1$ & $Y_2$ & $Y_3$ \\ |
| 105 | + \midrule |
| 106 | + 1.2 & ``UK'' & 0.3 & 7.8 & 4 & True \\ |
| 107 | + 3.2 & ``UK'' & 0.1 & 7.6 & 8 & False \\ |
| 108 | + \multicolumn{6}{c}{$\vdots$} \\ |
| 109 | + \bottomrule |
| 110 | + \end{tabular} |
| 111 | + }; |
| 112 | + \node[draw, rectangle] [fit=(title) (table)] {}; |
| 113 | + \end{scope} |
| 114 | + |
| 115 | + |
| 116 | + %Information flow |
| 117 | + \draw[edge, dashed] (dag.290) -- (ci-ci.160); |
| 118 | + \draw[edge, dashed] (dag) -- (test-test-case.north); |
| 119 | + \draw[edge, dashed] (test-test-case) -- (ci-ci); |
| 120 | + |
| 121 | + \draw[edge, dashed] (data-test-data.south) -- (data-test-data |- ci-ci.north); |
| 122 | + \draw[edge, dashed] (ci-ci) -- (estimate-estimate); |
| 123 | + |
| 124 | + \draw[edge, dashed] (estimate-estimate) -- (oracle-test-oracle.west |- estimate-estimate); |
| 125 | + \draw[edge, dashed] (oracle-test-oracle.east |- outcome-test-outcome) -- (outcome-test-outcome); |
| 126 | +\end{tikzpicture} |
| 127 | +\end{document} |
0 commit comments