%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Beamer Presentation
% LaTeX Template
% Version 1.0 (10/11/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ----------------------------------------------------------------------------------------
%	PACKAGES AND THEMES
% ----------------------------------------------------------------------------------------

\documentclass[hyperref={colorlinks=true}]{beamer}

\mode<presentation> {

  % The Beamer class comes with a number of default slide themes
  % which change the colors and layouts of slides. Below this is a list
  % of all the themes, uncomment each in turn to see what they look like.

  \usetheme{default}
  % \usetheme{AnnArbor}
  % \usetheme{Antibes}
  % \usetheme{Bergen}
  % \usetheme{Berkeley}
  % \usetheme{Berlin}
  % \usetheme{Boadilla}
  % \usetheme{CambridgeUS}
  % \usetheme{Copenhagen}
  % \usetheme{Darmstadt}
  % \usetheme{Dresden}
  % \usetheme{Frankfurt}
  % \usetheme{Goettingen}
  % \usetheme{Hannover}
  % \usetheme{Ilmenau}
  % \usetheme{JuanLesPins}
  % \usetheme{Luebeck}
  % \usetheme{Madrid}
  % \usetheme{Malmoe}
  % \usetheme{Marburg}
  % \usetheme{Montpellier}
  % \usetheme{PaloAlto}
  % \usetheme{Pittsburgh}
  % \usetheme{Rochester}
  % \usetheme{Singapore}
  % \usetheme{Szeged}
  % \usetheme{Warsaw}

  % As well as themes, the Beamer class has a number of color themes
  % for any slide theme. Uncomment each of these in turn to see how it
  % changes the colors of your current slide theme.

  % \usecolortheme{albatross}
  % \usecolortheme{beaver}
  % \usecolortheme{beetle}
  % \usecolortheme{crane}
  % \usecolortheme{dolphin}
  % \usecolortheme{dove}
  % \usecolortheme{fly}
  % \usecolortheme{lily}
  % \usecolortheme{orchid}
  \usecolortheme{rose}
  % \usecolortheme{seagull}
  % \usecolortheme{seahorse}
  % \usecolortheme{whale}
  % \usecolortheme{wolverine}

  % \setbeamertemplate{footline} % To remove the footer line in all slides uncomment this line
  % \setbeamertemplate{footline}[page number] % To replace the footer line in all slides with a simple slide count uncomment this line

  % \setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line
}

\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{cancel}
\usepackage{amsmath}
\usepackage{amssymb}
% \usepackage{showframe}
\usepackage{caption}

%\usepackage{subcaption}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{pgfplots}
\tcbuselibrary{skins}


\usepackage{subfig}
\beamertemplatenavigationsymbolsempty
\usepackage{color, colortbl}
\definecolor{LRed}{rgb}{1,.8,.8}
\definecolor{MRed}{rgb}{1,.6,.6}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows,shapes.multipart,fit,shapes.misc,positioning}
\newcommand{\der}[2]{\frac{\partial #1}{\partial #2}}
%\usepackage[labelformat=empty]{caption}


\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\makeatletter
\def\@listi{\leftmargin\leftmargini
            \topsep 3\p@ \@plus2\p@ \@minus2.5\p@
            \parsep 0\p@
            \itemsep\fill}
\let\@listI\@listi
\makeatother

% \makeatletter
% \def\@listii{\leftmargin\leftmarginii
%             \topsep 3\p@ \@plus2\p@ \@minus2.5\p@
%             \parsep 0\p@
%             \itemsep\fill}
% \let\@listI\@listii
% \makeatother

\makeatletter
\def\@listii{\leftmargin\leftmarginii
              \topsep    1ex
              \parsep    0\p@   \@plus\p@
              \itemsep   \fill}
\makeatother

\makeatletter
\def\@listiii{\leftmargin\leftmarginiii
              \topsep    1ex
              \parsep    0\p@   \@plus\p@
              \itemsep   \fill}
\makeatother

\makeatletter
\def\rowcolor{\noalign{\ifnum0=`}\fi\bmr@rowcolor}
\newcommand<>{\bmr@rowcolor}{%
  \alt#1%
  {\global\let\CT@do@color\CT@@do@color\@ifnextchar[\CT@rowa\CT@rowb}%
  {\ifnum0=`{\fi}\@gooble@rowcolor}%
}

\makeatletter
\renewcommand{\itemize}[1][]{%
  \beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
  \ifnum \@itemdepth >2\relax\@toodeep\else
    \advance\@itemdepth\@ne
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
    \list
      {\usebeamertemplate{itemize \beameritemnestingprefix item}}
      {\def\makelabel##1{%
          {%
            \hss\llap{{%
                \usebeamerfont*{itemize \beameritemnestingprefix item}%
                \usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
          }%
        }%
      }
  \fi%
  \setlength\itemsep{\fill}
    \ifnum \@itemdepth >1
        \vfill
    \fi%
  \beamer@cramped%
  \raggedright%
  \beamer@firstlineitemizeunskip%
}

\def\enditemize{\ifhmode\unskip\fi\endlist%
  \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body end}
  \ifnum \@itemdepth >1
        \vfil
  \fi%
  }
}
\makeatother

\newcommand\marktopleft[1]{%
    \tikz[overlay,remember picture]
        \node (marker-#1-a) at (0,1.5ex) {};%
}
\newcommand\markbottomright[1]{%
    \tikz[overlay,remember picture]
        \node (marker-#1-b) at (7ex,0) {};%
    \tikz[overlay,remember picture,thick,dashed,inner sep=3pt]
        \node[draw=black,rounded corners=0pt,fill=red,opacity=.2,fit=(marker-#1-a.center) (marker-#1-b.center)] {};%
}

% ----------------------------------------------------------------------------------------
%	TITLE PAGE
% ----------------------------------------------------------------------------------------

\title[]{Macro II} % The short title appears at the bottom of every slide, the full
% title is only on the title page

\author{Professor Griffy} % Your name
\institute[University at Albany, SUNY] % Your institution as it will appear on the bottom of
% every slide, may be shorthand to save space
{
UAlbany  \ % Your institution for the title page
}
\date{Spring 2025} % Date, can be changed to a custom date

\begin{document}

\begin{frame}
  \titlepage % Print the title page as the first slide
\end{frame}




% ----------------------------------------------------------------------------------------
%	PRESENTATION SLIDES
% ----------------------------------------------------------------------------------------

% ------------------------------------------------
\section{Introduction} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk
% ------------------------------------------------

\begin{frame}
  \frametitle{Introduction}
  \begin{itemize}
  \item So far: building tools to think about dynamic models.
  \item Now (and mostly rest of class):
    \begin{itemize}
    \item Build on those tools to make more applicable to economics.
    \item Use those tools to model the macroeconomy
    \end{itemize}
  \item Today:
    \begin{itemize}
    \item Introduce dynamic programming
    \end{itemize}
  \item Homework due in one week.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Feb. 25th and 27th}
  \begin{itemize}
  \item I will be in Japan. Time difference means class would be 11:30pm to 1:00am for me.
  \item Will likely post a video of lecture 10 (market structure), and the slides for lecture 11 (stochastic neoclassical growth).
  \item May post short assignment covering these topics.
  \item Plan is to teach 3/4.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\section{Dynamic Programming} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk

% ------------------------------------------------

\begin{frame}
  \frametitle{Dynamic Programming}
  \begin{itemize}
  \item Basic idea:
    \begin{itemize}
    \item We can express macro models in a sequential form.
    \item If we can write them \textit{recursively}, we get access to more tools to solve them.
    \end{itemize}
  \item We will start with a generic representation, give some important theorems, then discuss its use.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Sequential Problem}
  \begin{itemize}
  \item We can broadly state most macro (and economics problems in general) as
    \begin{align*}
      sup_{\{x_{t+1}\}_{t = 0}^{\infty}}&\sum_{t = 0}^{\infty}\beta^{t}r(x_{t}, x_{t + 1})\\
      \text{s.t.}\; &x_{t + 1}\in \Gamma(x_{t}),\;t = 0,1,2,...\\
      x_{0}\in X\;\text{given}
    \end{align*}
  \item A solution tells us $x_{t}$ at any time $t$.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Recursive Problem}
  \begin{itemize}
  \item We want to write the sequential problem recursively
    \begin{align*}
v(x) = sup_{y\in\Gamma(x)}[r(x, y) + \beta v(y)], \forall x\in X.
    \end{align*}
  \item \textit{We can also find solutions to this problem that solve the sequential problem.}
  \item We can make statements about the existence and uniqueness of those solutions.
  \item These statements are often easier when expressed this way.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\section{Contraction Mapping} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk

% ------------------------------------------------

\begin{frame}
  \frametitle{Some definitions}
  \begin{itemize}
  \item Metric space: a set $S$ together with a metric (distance function), $\rho: S\times S\Rightarrow R$, such that for all $x,y,z\in S$:
    \begin{enumerate}
    \item $\rho(x,y)\geq 0$, equality iff $x = y$
    \item $\rho(x,y)=\rho(y,x)$
    \item $\rho(x,z)\leq \rho(x,y) + \rho(y,z)$
    \end{enumerate}
  \item Complete metric space: A metric space $(S,\rho)$ is complete if every Cauchy sequence converge to an element in $S$.
  \item Cauchy sequnce: a sequence $\{x_{n}\}|_{n=0}^{\infty}$ for which $\rho(x_{n},x_{m}) < \epsilon$, any $\epsilon > 0$ for $n, m \geq N_{\epsilon}$
  \item i.e., a sequence that gets closer and closer together (think of a model converging to equilibrium).
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Contraction Mapping}
  \begin{itemize}
  \item If $(S, \rho)$ is a complete metric space and $T: S\Rightarrow S$ is a contraction mapping with modulus $\beta$, then
    \begin{enumerate}
    \item T has exactly one fixed point $v$ in S, and
    \item for any $v_{0}\in S$, $\rho(T^{n}v_{0}, v) \leq \beta^{n}\rho(v_{0}, v)$, $n=0,1,2,...$
    \end{enumerate}
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Blackwell's Sufficient Conditions}
  \begin{itemize}
  \item Let $X\subseteq R^{l}$, and let $B(X)$ be a space of bounded functions $f: X\Rightarrow R$, with the sup norm. Let $T: B(X)\Rightarrow B(X)$ be an operator satisfying
    \begin{enumerate}
    \item (monotonicity) $f, g\in B(X)$ and $f(x) \fleq g(x)$, for all $x\in X$, implies $(Tf)(x)\leq (Tg)(x)$, for all $x\in X$;
    \item (discounting) there exists some $\beta\in (0, 1)$ such that
      \begin{align*}
       [T(f + a)](x) \leq (Tf)(x) + \beta a,\;\text{all}\; f\in B(X), a \geq 0, x\in X
      \end{align*}
    \end{enumerate}
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Blackwell's Sufficient Applied}
  \begin{itemize}
  \item Simple problem:
    \begin{align*}
      (Tv)(k) = \max_{0\leq y\leq f(k)}\{U[f(k) - y] + \beta v(y)\}
    \end{align*}
  \item Monotonicity: $f, g\in B(X)$ and $f(x) \fleq g(x)$, for all $x\in X$, implies $(Tf)(x)\leq (Tg)(x)$, for all $x\in X$;
  \item define $g(x) \geq v(x)$, then
    \begin{align*}
      (Tg)(k) &= \max_{0\leq y\leq f(k)}\{U[f(k) - y] + \beta g(y)\}\\
              &\geq \max_{0\leq y\leq f(k)}\{U[f(k) - y] + \beta v(y)\}\\
              &= (Tv)(k)
    \end{align*}
  \item To see, take difference. $g(y) \geq v(y)\rightarrow$ monotone.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Blackwell's Sufficient Applied}
  \begin{itemize}
  \item Simple problem:
    \begin{align*}
      (Tv)(k) = \max_{0\leq y\leq f(k)}\{U[f(k) - y] + \beta v(y)\}
    \end{align*}
    \item (discounting) there exists some $\beta\in (0, 1)$ such that
      \begin{align*}
       [T(f + a)](x) \leq (Tf)(x) + \beta a,\;\text{all}\; f\in B(X), a \geq 0, x\in X
      \end{align*}
    \begin{align*}
      (Tv)(k + a) &= \max_{0\leq y\leq f(k)}\{U[f(k) - y] + \beta [v(y) + a]\}\\
                  &= \max_{0\leq y\leq f(k)}\{U[f(k) - y] + \beta v(y) + \beta a\}\\
                  &= (Tv)(k) + \beta a
    \end{align*}
  \item Thus, contraction mapping. Existence and uniqueness.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\section{Theorem of the Maximum} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk

% ------------------------------------------------

\begin{frame}
  \frametitle{Correspondences}
  \begin{itemize}
  \item We will define a correspondence $\Gamma(x)$ as
    \begin{itemize}
    \item a set of feasible values of $y\in Y$ for $x\in X$,
    \item where $X$ can be thought of as the set of possible states
    \item and $Y$ the set of possible choices.
    \end{itemize}
  \item The easiest example: the budget constraint.
  \item There are many feasible choices,
  \item we will pick on the maximizes the return function.
  \item Argmax correspondence:
    \begin{itemize}
    \item We define a policy function $G(x)$ as a correspondence, where
    \item $G(x) = \{y\in\Gamma(x): f(x, y) = h(x)\}$
    \end{itemize}
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Compact Sets}
  \begin{itemize}
  \item A compact set is a set that
    \begin{enumerate}
    \item is closed: contains all of its limit points.
    \item is bounded: all points are within a finite distance of each other.
    \end{enumerate}
  \item Useful: most often applied to choice sets.
  \item Means that choices are finite and feasible.
  \end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Upper and Lower Hemi-Continuity}
  \begin{itemize}
  \item Two notions of continuity, (really) loosely:
    \begin{enumerate}
    \item Upper hemi-continuity: any choice $y$ is in the set $\Gamma(x)$ (closed).
    \item Lower hemi-continuity: nearby $x$ are in $\Gamma(x)$.
    \end{enumerate}

  \end{itemize}
\centering\includegraphics[width=0.7\textwidth]{HemiContinuity.jpg}
\begin{itemize}
\item Lower hemi-continuity: $x_{2}$ not lhc
\item Upper hemi-continuity: $x_{1}$ not uhc
\end{itemize}

\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Upper and Lower Hemi-Continuity}
  \begin{itemize}
  \item Upper hemi-continuity is useful:
    \begin{itemize}
    \item Upper hemi-continuity preserves compactness:
    \item if $C\subseteq X$ is compact and $\Gamma$ is uhc,
    \item $\Gamma(C)$ is compact.
    \end{itemize}
  \item So if we place restrictions on $X$, our choice set is still in the correspondence.
  \item Allows our maximization problems to have solutions.
  \item If $\Gamma$ is single-valued and uhc, it is continuous.
\end{itemize}
\end{frame}

% ------------------------------------------------

\begin{frame}
  \frametitle{Theorem of the Maximum}
  \begin{itemize}
  \item (conditions): Let $X\subseteq R^{l}$ and $Y\subseteq R^{m}$, let $f: X\times Y\Rightarrow R$ be a continuous function, and let $\Gamma: X\Rightarrow Y$ be a compact-valued and continuous correspondence.
  \item (implications): Then the function: $h: X\rightarrow R$ defined as $h(x) = \max_{y\in\Gamma(x)} f(x,y)$ and the correspondence $G: X\Rightarrow Y$ defined as $G(x) = \{y\in \Gamma(x): f(x, y) = h(x)\}$ is
    \begin{enumerate}
    \item nonempty,
    \item compact-valued, and
    \item upper hemi-continuous.
    \end{enumerate}
  \item Why is this useful?
    \begin{itemize}
    \item under a few more assumptions ($\Gamma$ is convex, $f$ is strictly concave in $y$)
    \item we can obtain the maxmized value of $f$ using the control $g$.
    \item and as a result, $h(x)$.
    \end{itemize}
  \end{itemize}
\end{frame}

% ------------------------------------------------

\section{Stochastic Dynamic Programming} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk

% ------------------------------------------------

% \begin{frame}
%   \frametitle{Stochastic Dynamic Programming}
%   \begin{itemize}
%   \item (conditions): Let $X\subseteq R^{l}$ and $Y\subseteq R^{m}$, let $f: X\times Y\Rightarrow R$ be a continuous function, and let $\Gamma: X\Rightarrow Y$ be a compact-valued and continuous correspondence.
%   \item (implications): Then the function: $h: X\rightarrow R$ defined as $h(x) = \max_{y\in\Gamma(x)} f(x,y)$ and the correspondence $G: X\Rightarrow Y$ defined as $G(x) = \{y\in \Gamma(x): f(x, y) = h(x)\}$ is
%     \begin{enumerate}
%     \item nonempty,
%     \item compact-valued, and
%     \item upper hemi-continuous.
%     \end{enumerate}
%   \item Why is this useful?
%     \begin{itemize}
%     \item under a few more assumptions ($\Gamma$ is convex, $f$ is strictly concave in $y$)
%     \item we can obtain the maxmized value of $f$ using the control $g$.
%     \item and as a result, $h(x)$.
%     \end{itemize}
%   \end{itemize}
% \end{frame}

% ------------------------------------------------

\begin{frame}\frametitle{Stochastic Dynamic Programming}
Returning to our initial definition, let $r$ be the return function and $u$ the control vector with a state that evolves by $x_{t+1} = h(x_t,u_t, \varepsilon_{t+1})$. The sequential problem looks like \\
\begin{align*}
\max_{\{ u_t \}_{t=0}^{\infty}} \mathbb{E}_0 &\sum_{t=0}^{\infty} \beta^t r(x_t,u_t) \\ \text{s.t.} \qquad x_{t+1} &= h(x_t,u_t, \varepsilon_{t+1}) \: \: \forall t, \: \: \: x_0 \: \: \text{given}. \\
\end{align*}
\begin{itemize}
\item where $\varepsilon_t$ is some stochastic process (``shock'') with a defined support and some distribution function $F(\varepsilon)$
\item we usually take this to be independent and identically distributed \emph{or} Markov. \\ \vspace{1em}
\end{itemize}
\end{frame}

% --------------------------------------------------------------

\begin{frame}\frametitle{The Equilibrium}
What is the equilibrium in this environment? What are the equilibrium objects? \\ \vspace{1em}
\begin{itemize}
\setlength\itemsep{1.5em}
\item A sequence $\{ u_t \}_{t=0}^{\infty}$ for every possible sequence of realizations for $\varepsilon$'s
\item This is not so bad insofar as, at any given point in time, the problem has an infinite horizon and looks the same
\item The above can be unwieldy, so we can instead find a \emph{policy function} that tells the agent, at any point in time, what they should do given some observed $x_t$ considering what they expect the $\varepsilon$'s to be in the future \\ \vspace{1em}
\end{itemize}
\end{frame}

% --------------------------------------------------------------

\begin{frame}\frametitle{The Recursive Problem}
Now let's translate this into a recursive problem. \\
\begin{align*}
& V(x) = \max\limits_{u} \Big\{ r(x,u) + \beta \mathbb{E} \Big[ V\big( \underbrace{h(x,u,\varepsilon')}_{x'} \big) | x \Big] \Big\} \\\\
& \text{where} \qquad \mathbb{E} \Big[ V\big( h(x,u,\varepsilon') \big) | x \Big] \equiv \int_{\xi} V\big( h(x,u,\varepsilon') \big)dF(\varepsilon') \\
\end{align*}
How do we solve this? The obvious way: FOCs:
\begin{align*}
\frac{dV(x)}{du} = 0: \qquad r_2(x,u) + \beta \frac{d}{du} \mathbb{E} \Big[ V\big( h(x,u,\varepsilon') \big) | x \Big] = 0 \\
\end{align*}
What allows us to pass the derivative through the expectation?
\end{frame}

% --------------------------------------------------------------

\begin{frame}\frametitle{Differentiation under Integration}
If the limits of integration \emph{do not} depend on the control $u$, we can directly apply \textbf{Leibniz's rule} for differentiation under the integral (i.e., you just do it). \\
\begin{align*}
r_2(x,u) + \beta \mathbb{E} \left[ \frac{dV(h(x,u,\varepsilon'))}{dx'} h_2(x,u,\varepsilon') \big| x \right] = 0 \\
\end{align*}
Alas, another roadblock: we do not know what $dV(x')/dx'$ is. Now we'll want to apply the Envelope Theorem. That is, we'll want to find $dV(x)/dx$. \\ \vspace{1.5em}
\end{frame}

% --------------------------------------------------------------

\begin{frame}\frametitle{Envelope Theorem}
  \begin{itemize}
  \item The envelope theorem always seems to be a source of confusion.
  \item It states (loosely) that when we are maximizing a value function $V$ with a choice $x$, we can proceed as though all other choices are at their optimal values.
  \item Why is this important? Because in principle, $u$ affects the choice of $u'$.
\begin{align*}
r_2(x,u) &+ \beta \mathbb{E} \left[ \frac{dV(h(x,u,\varepsilon'))}{dx'} h_2(x,u,\varepsilon') \big| x \right] = 0 \\
r_2(x,u) &+ \beta \mathbb{E} [ (r_{1}(x',u') \\&+ (r_{2}(x',u') + \beta\mathbb{E}\der{V}{u'}h_{2}(x',u',\epsilon''))\der{u'}{x}) h_2(x,u,\varepsilon') \big| x] = 0 \\
r_2(x,u) &+ \beta \mathbb{E} [ (r_{1}(x',u') \\&+ \cancel{(r_{2}(x',u') + \beta\mathbb{E}\der{V}{u'}h_{2}(x',u',\epsilon''))}\der{u'}{x}) h_2(x,u,\varepsilon') \big| x] = 0
\end{align*}
\item We can cancel future terms because we optimally pick $u'$
\item i.e., we plug in $g(x)$ for $u$.
  \end{itemize}
\end{frame}

% --------------------------------------------------------------

\begin{frame}\frametitle{Envelope Theorem II}
\emph{If} the problem we are working with can be written in such a way such that the transition does not depend on $x$, this can be greatly simplified to \\
\begin{align*}
\frac{dV(x)}{dx} = r_1(x,u) \qquad \Longrightarrow \qquad \frac{dV(x')}{dx'} = r_1(x',u'). \\
\end{align*}
Plugging this back into the FOC gives the stochastic EE. \\
\begin{align*}
r_2(x,u) + \beta \mathbb{E} \left[ r_1(x',u') h_2(x,u,\varepsilon') \big| x \right] = 0 \\
\end{align*}
% Now: return to neoclassical growth. Suppose that capital evolves according to $k' = (1-\delta)k + a + \varepsilon$ (where $\varepsilon$ is iid), and that there is full depreciation ($\delta = 1$).
\end{frame}

% --------------------------------------------------------------

% \begin{frame}\frametitle{Stochastic Neoclassical Growth}
% \begin{align*}
% & V(k,\varepsilon) = \max\limits_{c,k'} \left\{ ln(c) + \beta \mathbb{E} \left[ V(k', \varepsilon ') \right] \right\} \qquad \text{s.t.} \qquad c = k^{\alpha} - k' + \varepsilon \\\\
% & \Longrightarrow \quad V(k,\varepsilon) = \max\limits_{k'} \left\{ ln(k^{\alpha} - k' + \varepsilon) + \beta \mathbb{E} \left[ V(k', \varepsilon ') \right] \right\} \\
% \end{align*}
% The FOC is given by \\
% \begin{align*}
% \frac{1}{k^{\alpha} - k' + \varepsilon} = \beta \mathbb{E} \left[ \frac{dV(k',\varepsilon')}{dk'} \right], \\
% \end{align*}
% where we passed the derivative through the integral using Leibniz's rule.
% \end{frame}

% % --------------------------------------------------------------

% \begin{frame}\frametitle{Solving}
% Now for the Envelope Theorem. \\
% \begin{align*}
% \frac{dV(k,\varepsilon)}{dk} = \frac{\alpha k^{\alpha-1}}{k^{\alpha} - k' + \varepsilon} \qquad \Longrightarrow \qquad \frac{dV(k',\varepsilon')}{dk'} = \frac{\alpha k'^{\alpha-1}}{k'^{\alpha} - k'' + \varepsilon'} \\
% \end{align*}
% Plugging this back into the FOC, we have the EE (which we can rewrite however we want). \\
% \begin{align*}
% \frac{1}{k^{\alpha} - k' + \varepsilon} & = \beta \mathbb{E} \left[ \frac{\alpha k'^{\alpha-1}}{k'^{\alpha} - k'' + \varepsilon'} \right] \\\\
% \frac{1}{c} & = \beta \mathbb{E} \left[ \frac{\alpha k'^{\alpha-1}}{c'} \right]
% \end{align*}
% \end{frame}

% ------------------------------------------------

\section{Conclusion}
% ------------------------------------------------


\begin{frame}
  \frametitle{Next Time}
  \begin{itemize}
  \item Next: Permanent Income and Consumption Smoothing
  \item Homework due next Thursday.
  \end{itemize}
\end{frame}


\end{document}
