Created
November 1, 2013 16:37
-
-
Save fditraglia/7268097 to your computer and use it in GitHub Desktop.
This file contains some simple flowchart examples in tikz. The content is based on slides from my presentation at the 2013 Midwest Econometrics Group meetings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % I learned how to make these flowcharts by looking at some very helpful examples online: | |
| % | |
| % http://www.texample.net/tikz/examples/simple-flow-chart/ | |
| % http://www.texample.net/tikz/examples/borrowers-and-lenders/ | |
| % http://www.texample.net/tikz/examples/entity-relationship-diagram/ | |
| % | |
| % For a long list of tikz examples, see http://www.texample.net/tikz/examples/ | |
| \documentclass{beamer} | |
| \usepackage{amssymb, amsmath, amsthm} | |
| %This is the package for strking out mathematical expressions | |
| \usepackage{cancel} | |
| %The flowcharts are made using tikz and the following libraries | |
| \usepackage{tikz} | |
| \usetikzlibrary{shapes, backgrounds, arrows, positioning} | |
| %To avoid defining the style of every element of the flowcharts "in situ" I create a number of "styles" in advance and give them names. | |
| %This defines the arrows between boxes - I call them "myline" | |
| \tikzstyle{myline} = [draw, ->, thick, shorten <=4pt, shorten >=4pt] | |
| %This defines the yellow "input" boxes - I call them "input" | |
| \tikzstyle{input} = [rectangle,rounded corners,draw=black, top color=white, bottom color=yellow!50,very thick, inner sep=1em, minimum size=3em, text centered, text width = 6em] | |
| %This defines the blue boxes - I call them "process" | |
| \tikzstyle{process} = [rectangle,rounded corners, draw=black, top color=white, bottom color=blue!18,very thick, inner sep=0.5em, minimum size=3em, text centered, text width = 8em, minimum height = 5em] | |
| %This defines the green boxes - I call them "ouput" | |
| \tikzstyle{output} = [rectangle,rounded corners,draw=black, top color=white, bottom color=green!30,very thick, inner sep=1em, minimum size=3em, text centered, text width = 6.5em] | |
| %This defines the red bloxes - I call them "danger" | |
| \tikzstyle{danger} = [rectangle,rounded corners,draw=black, top color=white, bottom color=red!30,very thick, inner sep=1em, minimum size=3em, text centered, text width = 6em] | |
| \begin{document} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame}[fragile] | |
| \frametitle{Generalized Focused Information Criterion (GFIC)} | |
| \begin{figure} | |
| \centering | |
| %node distance controls how tightly packed the flowchart is. | |
| \begin{tikzpicture}[node distance=1cm] | |
| % The basic syntax for a node is: | |
| % | |
| % \node[STYLE] (NAME) {TEXT} | |
| % | |
| % STYLE can be either style commands of the name of a pre-defined style, se defined above. | |
| % NAME is just a name you will use to refer to the node. | |
| % TEXT is whatever you want inside of the node. | |
| \node[danger] (additional) {Additional Assumptions?}; | |
| % All the nodes on this slide are positioned relative to "additional" which makes the layout easy | |
| \node[input, left=of additional] (baseline) {Baseline Assumptions}; | |
| \node[input, right=of additional] (data) {Data}; | |
| \node[output, below=of additional](target) {Estimation \& Inference for $\mu$}; | |
| % Here I tell tikz to draw a path between nodes using their names. The style is defined above. | |
| \path [myline] (baseline) -- (target); | |
| \path [myline] (data) -- (target); | |
| \path [myline] (additional) -- (target); | |
| \end{tikzpicture} | |
| \end{figure} | |
| \begin{enumerate} | |
| \item Choose False Assumptions on Purpose | |
| \item Focused Choice of Assumptions | |
| \item Local mis-specification | |
| \item Averaging, Inference post-selection | |
| \end{enumerate} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame}[fragile] | |
| \frametitle{GMM Framework} | |
| \footnotesize | |
| \begin{tikzpicture}[node distance=1cm] | |
| \node[input] (baseline) {Baseline Assumptions}; | |
| \node[process, below=of baseline] (params) {$(\theta,\gamma)$}; | |
| \node[process, right=of params] (MCs) {$E[g(Z,\theta, \gamma)]=0$}; | |
| \node[process, right=of MCs] (GMM) {$ (\widehat{\theta}, \widehat{\gamma})$}; | |
| \node[input, above=of GMM] (data) {Data}; | |
| \node[output, below=of GMM] (target) {Estimation \& Inference for $\mu = \varphi(\theta, \gamma)$}; | |
| \path [myline] (baseline) -- (params); | |
| \path [myline] (baseline) -- (MCs); | |
| \path [myline] (params) -- (MCs); | |
| \path [myline] (MCs) -- (GMM); | |
| \path [myline] (data) -- (GMM); | |
| \path [myline] (GMM) -- (target); | |
| \end{tikzpicture} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame}[fragile] | |
| \frametitle{Additional Assumption -- Parameter Restriction} | |
| \footnotesize | |
| \begin{tikzpicture}[node distance=1cm] | |
| \node[input] (baseline) {Baseline Assumptions}; | |
| \node[process, below=of baseline] (params) {$(\theta,\alert{\cancelto{\gamma_0}{\gamma}})$}; | |
| \node[danger, below=of params](restrict) {Restriction $\gamma = \gamma_0$}; | |
| \node[process, right=of params] (MCs) {$E[g(Z,\theta, \alert{\cancelto{\gamma_0}{\gamma}})]=0$}; | |
| \node[process, right=of MCs] (GMM) {$ \alert{\widetilde{\theta}}$}; | |
| \node[input, above=of GMM] (data) {Data}; | |
| \node[output, below=of GMM] (target) {Estimation \& Inference for $\mu = \varphi(\theta, \alert{\cancelto{\gamma_0}{\gamma}})$}; | |
| \path [myline] (baseline) -- (params); | |
| \path [myline] (restrict) -- (params); | |
| \path [myline] (baseline) -- (MCs); | |
| \path [myline] (params) -- (MCs); | |
| \path [myline] (MCs) -- (GMM); | |
| \path [myline] (data) -- (GMM); | |
| \path [myline] (GMM) -- (target); | |
| \end{tikzpicture} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame}[fragile] | |
| \frametitle{Additional Assumption -- Moment Conditions} | |
| \footnotesize | |
| \begin{tikzpicture}[node distance=1cm] | |
| \node[input] (baseline) {Baseline Assumptions}; | |
| \node[process, below=of baseline] (params) {$(\theta,\gamma)$}; | |
| \node[process, right=of params] (MCs) {$E[g(Z,\theta, \gamma)]=0$ $\alert{E[h(Z,\theta, \gamma)]=0}$}; | |
| \node[process, right=of MCs] (GMM) {$\alert{(\widehat{\theta}^*, \widehat{\gamma}^*)}$}; | |
| \node[input, above=of GMM] (data) {Data}; | |
| \node[danger, below=of MCs] (moreMCs) {Moment Assumption}; | |
| \node[output, below=of GMM] (target) {Estimation \& Inference for $\mu = \varphi(\theta, \gamma)$}; | |
| \path [myline] (baseline) -- (params); | |
| \path [myline] (baseline) -- (MCs); | |
| \path [myline] (params) -- (MCs); | |
| \path [myline] (MCs) -- (GMM); | |
| \path [myline] (data) -- (GMM); | |
| \path [myline] (GMM) -- (target); | |
| \path [myline] (moreMCs) -- (MCs); | |
| \end{tikzpicture} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame}[fragile] | |
| \frametitle{Both at Once} | |
| \footnotesize | |
| \begin{tikzpicture}[node distance=1cm] | |
| \node[input] (baseline) {Baseline Assumptions}; | |
| \node[process, below=of baseline] (params) {$(\theta,\alert{\cancelto{\gamma_0}{\gamma}})$}; | |
| \node[process, right=of params] (MCs) {$E[g(Z,\theta, \alert{\cancelto{\gamma_0}{\gamma}})]=0$ $\alert{E[h(Z,\theta, \alert{\cancelto{\gamma_0}{\gamma}})]=0}$}; | |
| \node[process, right=of MCs] (GMM) {$\alert{\widetilde{\theta}^*}$}; | |
| \node[danger, below=of params](restrict) {Restriction $\gamma = \gamma_0$}; | |
| \node[input, above=of GMM] (data) {Data}; | |
| \node[danger, below=of MCs] (moreMCs) {Moment Assumption}; | |
| \node[output, below=of GMM] (target) {Estimation \& Inference for $\mu = \varphi(\theta, \alert{\cancelto{\gamma_0}{\gamma}})$}; | |
| \path [myline] (baseline) -- (params); | |
| \path [myline] (restrict) -- (params); | |
| \path [myline] (baseline) -- (MCs); | |
| \path [myline] (params) -- (MCs); | |
| \path [myline] (MCs) -- (GMM); | |
| \path [myline] (data) -- (GMM); | |
| \path [myline] (GMM) -- (target); | |
| \path [myline] (moreMCs) -- (MCs); | |
| \end{tikzpicture} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame} | |
| \frametitle{GFIC Asymptotics -- Local Mis-Specification} | |
| \footnotesize | |
| \begin{tikzpicture}[node distance=1cm] | |
| \node[input] (baseline) {Baseline Assumptions}; | |
| \node[process, below=of baseline] (params) {$(\theta,\alert{\cancelto{\gamma_n}{\gamma}})$}; | |
| \node[process, right=of params] (MCs) {$\alert{E_n}[g(Z,\theta, \alert{\cancelto{\gamma_n}{\gamma}})]=0$ $\alert{E_n}[h(Z,\theta, \alert{\cancelto{\gamma_n}{\gamma}})]=\alert{\tau_n}$}; | |
| \node[process, right=of MCs] (GMM) {Choice of MCs \& Parameter Restrictions}; | |
| \node[input, below=of params](restrict) {$\gamma_n = \gamma_0 + \frac{\delta}{\sqrt{n}}$}; | |
| \node[input, above=of GMM] (data) {Data}; | |
| \node[input, below=of MCs] (moreMCs) {$\tau_n = \frac{\tau}{\sqrt{n}}$}; | |
| \node[output, below=of GMM] (target) {AMSE for Estimator of $\mu = \varphi(\theta, \alert{\cancelto{\gamma_n}{\gamma}})$}; | |
| \path [myline] (baseline) -- (params); | |
| \path [myline] (restrict) -- (params); | |
| \path [myline] (baseline) -- (MCs); | |
| \path [myline] (params) -- (MCs); | |
| \path [myline] (MCs) -- (GMM); | |
| \path [myline] (data) -- (GMM); | |
| \path [myline] (GMM) -- (target); | |
| \path [myline] (moreMCs) -- (MCs); | |
| \end{tikzpicture} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \begin{frame}[fragile] | |
| \frametitle{Estimating $\delta, \tau$} | |
| \footnotesize | |
| \begin{tikzpicture}[node distance=1cm] | |
| \node[input] (baseline) {Baseline Assumptions}; | |
| \node[process, below=of baseline] (params) {$(\theta,\gamma)$}; | |
| \node[process, right=of params] (MCs) {$E[g(Z,\theta, \gamma)]=0$}; | |
| \node[process, right=of MCs] (GMM) {$ \alert{\widehat{\beta}_v = (\widehat{\theta}_v, \widehat{\gamma}_v)}$}; | |
| \node[input, above=of GMM] (data) {Data}; | |
| \node[output, below=of GMM] (delta) {$\widehat{\delta}/\sqrt{n} = \alert{\widehat{\gamma}_v} - \gamma_0$}; | |
| \node[output, below=of MCs] (tau) {$\widehat{\tau}/\sqrt{n} = h_n(\alert{\widehat{\beta}_v})$}; | |
| \path [myline] (baseline) -- (params); | |
| \path [myline] (baseline) -- (MCs); | |
| \path [myline] (params) -- (MCs); | |
| \path [myline] (MCs) -- (GMM); | |
| \path [myline] (data) -- (GMM); | |
| \path [myline] (GMM) -- (delta); | |
| \path [myline] (GMM) -- (tau); | |
| \end{tikzpicture} | |
| \end{frame} | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| \end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment