%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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{tikz}
\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}}

\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 2026} % 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{Announcements}
  \begin{itemize}
  \item Midterm on Thursday!
  \item Today: continue solutions methods: value function iteration.
  \item Using:
    \begin{enumerate}
    \item Grid search;
    \item Interpolation (grid search with functions filling in between nodes).
    \end{enumerate}
  \item Go through examples with neoclassical growth model.
  \item Homework assignment: do same with RBC model (HW5).
  \end{itemize}
\end{frame}

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

\begin{frame}
  \frametitle{Solving a Model}
  \begin{itemize}
  \item When we say ``solve a model'' what do we mean?
    \begin{enumerate}
    \item Find the equilibrium of the model.
    \item Generally, determine the policy functions.
    \item Determine the transition equations given the individual and aggregate state.
    \item i.e., aggregate up the policy functions and determine prices given distributions.
    \end{enumerate}
  \item Generically, this is hard: many states, non-linear decision rules, etc.
  \end{itemize}
\end{frame}

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

\begin{frame}
  \frametitle{Solving a Model}
  \begin{itemize}
  \item Generically, this is hard: many states, non-linear decision rules, etc.
  \item Much of quantitative macro is about finding ``shortcuts'' without sacrificing accuracy of solution (some we have seen):
    \begin{enumerate}
    \item Planner's problem: use welfare theorems to remove prices from problem.
    \item Rational expectations \& complete markets: Aggregate worker decision rules by assuming they make same predictions about future prices, and face same consumption risk.
    \item Exogenous wage distribution/prices: agents do not respond to decisions of other agents.
    \item Block Recursive Equilibrium: agents face an equilibrium with individual prices, i.e., no need to know distribution.
    \end{enumerate}
  \item Linearization: assume the economy is close enough to steady-state that transition equations (i.e., policy functions) are close to linear within small deviations.
  \item Value function iteration: discretize state space and solve model at ``nodes'' in state space.
  \end{itemize}
\end{frame}

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

\section{Neoclassical Growth Model} % 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{Neoclassical Growth Model}
\begin{itemize}
\item Problem:
  \begin{align}
    V(k) &= \max_{k'} u(c) + \beta V(k')\\
    c + k' &= F(k) + (1 - \delta)k
  \end{align}
\item Assume power utility: $u(c) = \frac{c^{1 - \sigma} - 1}{1 - \sigma}$
\item Cobb-Douglas Production: $F(k) = k^{\alpha}$
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function Iteration}
\begin{itemize}
\item Basic approach to value function iteration:
\begin{enumerate}
\item Create grid of points for each dimension in state-space.
\item Specify terminal condition $V_{t}$ for $t = T$ at each point in state-space.
\item Solve problem of agent in period $T-1$: $V_{t}(y) = max_{x} u(c(x)) + \beta E[ V_{t + 1}(x)]$.
\item $x$ is policy function, which yields the largest value from $\{x_{1},...,x_{N}\}$, where $N$ is the number of grid points.
\item Check to see if function has converged, i.e., $|V_{t} - V_{t + 1}| < errtol$
\item Update $V_{t + 1} = V_{t}$
\end{enumerate}
\item Interpolation: same idea, but functions used to fill in between grid points.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Parameter Values}
\begin{itemize}
\item Before we can solve the model (or write down grids) we need parameter values.
\item Pick reasonable ones from the literature:
  \begin{itemize}
  \item $\alpha = 0.3$ (roughly capital share)
  \item $\sigma = 2$ (standard risk aversion)
  \item $\delta = 0.1$ (annual depreciation $10\%$)
  \item $\beta = 0.96$ (annual interest rate $\approx 4.2\%$)
  \end{itemize}
\item If we were estimating this model: we would evaluate the performance of the model given these parameters.
\item i.e., how does it fit the data if we use this set of parameters.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Grids}
\begin{itemize}
\item Want: smallest grids reasonable.
\item Find $k^{*}$, pick grids around this.
\item Euler Equation
  \begin{align}
    u'(c) &= \beta[\alpha k^{\alpha - 1} + (1 - \delta)]u'(c')
  \end{align}
\item In steady-state, $c = c' = c^{*}$
  \begin{align}
    \rightarrow u'(c^{*}) &= \beta[\alpha k^{*\alpha - 1} + (1 - \delta)]u'(c^{*})\\
    1 &= \beta[\alpha k^{*\alpha - 1} + (1 - \delta)]\\
    (\frac{1}{\alpha\beta} - \frac{1 - \delta}{\alpha})^{\frac{1}{\alpha - 1}} &= k^{*}\\
  \end{align}
\item For our parameter values, $k^{*} = 2.92$.
\item Pick grids st $k, k'\in [0.66\times k^{*},1.5\times k^{*}]$
\item Arbitrary, probably larger than needed.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Neoclassical Growth Model}
\begin{itemize}
\item Problem:
  \begin{align}
    V(k) &= \max_{k'} u(c) + \beta V(k')\\
    c + k' &= F(k) + (1 - \delta)k
  \end{align}
\item Assume power utility: $u(c) = \frac{c^{1 - \sigma} - 1}{1 - \sigma}$
\item Cobb-Douglas Production: $F(k) = k^{\alpha}$
\item $k, k'\in \{k_{1},...,k_{N}\}$
\item $V_{0} = $? Safest bet to set it to zero at all $k$.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function First Iteration}
\begin{itemize}
\item Intuitively, take as given capital today ($\bar{k}$), choose capital in the future that maximizes value.
\item Problem:
  \begin{align}
    V(\bar{k}) &= \max_{k'\in{k_{1},...,k_{N}}} u(c) + \beta \cancel{V(k')}\\
    c + k' &= F(\bar{k}) + (1 - \delta)\bar{k}
  \end{align}
\item That is, policy function is $k_{i}$ where $i$ is the index of the optimal policy from the following:
  \begin{align}
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{1}) &+ \beta \times 0\\
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{2}) &+ \beta \times 0\\
    \dots&\\
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{N}) &+ \beta \times 0
  \end{align}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function First Iteration}
\begin{itemize}
\item Value of $V_{t + 1}(k')$ given $k = \bar{k}$ (x-axis is num. of grid pts.):
\includegraphics[width=0.9\textwidth]{Period1.jpg}
\item What is optimal choice?
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function First Iteration}
\begin{itemize}
\item Now, check if problem has converged.
\item What does this mean?
\item The value in the current state is not changing over time.
\item i.e., $V_{t}(k) \approx V_{t + 1}(k)$.
\item First iteration: it won't be.
\item What do we do now?
\item Update the continuation value:
\item $V_{t + 1} = V_{t}$ for all $k$
\item Solve same problem again.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function Second Iteration}
\begin{itemize}
\item Solved for $V(k')$ in previous iteration.
\item Again, faced with maximization problem given capital $\bar{k}$ today:
  \begin{align}
    V(\bar{k}) &= \max_{k'\in{k_{1},...,k_{N}}} u(c) + \beta V(k')\\
    c + k' &= F(\bar{k}) + (1 - \delta)\bar{k}
  \end{align}
\item Note that the continuation value is {\it\bf not} zero!
  \begin{align}
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{1}) &+ \beta V(k_{1})\\
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{2}) &+ \beta V(k_{2})\\
    \dots&\\
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{N}) &+ \beta V(k_{N})
  \end{align}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function Second Iteration}
\begin{itemize}
\item Value of $V_{t + 1}(k')$ given $k = \bar{k}$ (x-axis is num. of grid pts.):
\includegraphics[width=0.9\textwidth]{Period2.jpg}
\item What is optimal choice?
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Value Function Second Iteration}
\begin{itemize}
\item We check again to see if it has converged.
\item is $V_{t}(k) \approx V_{t + 1}(k)$.
\item What do we do now?
\item Update the continuation value:
\item $V_{t + 1} = V_{t}$ for all $k$
\item Solve same problem again.
\item Keep doing this until the difference is very small.
\end{itemize}
\end{frame}

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

\section{Interpolation} % 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{Great, we're done!}
\includegraphics[width=0.9\textwidth]{ThatWasEasy.jpg}
\begin{itemize}
\item Not so fast: this isn't very accurate.
\item Very slow if we have large numbers of states \& grid points (scales exponentially).
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Fundamental Problem}
\begin{itemize}
\item The reason we need to use a computer to solve this problem is that we {\it don't know} the function $V(k)$.
  \begin{align}
    V(k) &= \max_{k'} u(c) + \beta V(k')\\
    c + k' &= F(k) + (1 - \delta)k
  \end{align}
\item What is we {\it approximate} $V(k)$ with other functions?
\item Some useful properties we can pick these functions to have:
  \begin{itemize}
  \item Continuous
  \item Differentiable
  \end{itemize}
\item If our approximation is accurate enough, we can drop some grid points!
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Interpolation}
\begin{itemize}
\item Again, take capital today as given $k = \bar{k}$. Grid search:
  \begin{align}
    V(\bar{k}) &= \max_{k'\in{k_{1},...,k_{N}}} u(c) + \beta  V(k')\\
    c + k' &= F(\bar{k}) + (1 - \delta)\bar{k}
  \end{align}
\item Optimal policy is the index largest of:
  \begin{align}
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{1}) &+ \beta V(k_{1})\\
    \dots&\\
    u(F(\bar{k}) + (1 - \delta)\bar{k} - k_{N}) &+ \beta V(k_{N})
  \end{align}
\item Call interpolated function $\hat{V}(k)$. Then,
  \begin{align}
    V(\bar{k}) &= \max_{k'} u(c) + \beta \hat{V}(k')\\
    c + k' &= F(\bar{k}) + (1 - \delta)\bar{k}
  \end{align}
\item Where $k'$ solves
  \begin{align}
    u'(F'(\bar{k}) + (1 - \delta)\bar{k} - k') &= \beta\der{\hat{V}}{k'}
  \end{align}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Updating}
\begin{itemize}
\item We do {\it exactly the same thing as before}:
  \begin{align}
    V(\bar{k}) = u(c(k^{'*})) + \beta V(k^{'*})
  \end{align}
\item For each $\bar{k}$. Then, we check the convergence criteria:
  \begin{align}
    |V_{t} - V_{t + 1}| < errtol
  \end{align}
\item How do we create the function $\hat{V}(k)$?
\item ``Connect the dots'' of $V_{t}(k)$ between all capital levels in order.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Interpolation}
\begin{itemize}
\item Left is value function for grid search. Right is for (linearly) interpolated function:
\includegraphics[width=0.45\textwidth]{NotInterpolated.jpg}%
\includegraphics[width=0.45\textwidth]{Interpolated.jpg}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Interpolation}
\begin{itemize}
\item In constructing our function $\hat{V}(k)$, we need to choose an interpolation scheme.
\item Roughly, what {\it order} function do we believe will be accurate enough to mimick the value function:
  \begin{itemize}
  \item First-order (linear)
  \item Third-order (cubic)
  \item Fifth-order (quintic)
  \end{itemize}
\item Some other useful interpolation routines:
  \begin{itemize}
  \item PCHIP (piecewise cubic hermite interpolating polynomial): shape-preserving (not ``wiggly'') continuous 3rd order spline with continuous first derivative.
  \end{itemize}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Interpolation}
\begin{itemize}
\item Choice DOES matter:
\end{itemize}
\includegraphics[width=0.9\textwidth]{InterpolationComparison.png}
\end{frame}

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

\begin{frame}
\frametitle{Polynomial Interpolation}
\begin{itemize}
\item Suppose we have a function $y = f(x)$ for which we know the values of $y$ at $\{x_{1},...,x_{n}\}$.
\item Then, the nth-order polynomial approximation to this function $f$ is given by
  \begin{align}
    f(x) \approx P_{n}(x) = a_{n}x^{n} + a_{n - 1}x^{n - 1} + ... + a_{1}x + a_{0}
  \end{align}
\item Then, we have a linear system with $n$ coefficients.
\item We could write this as $y = X\beta$. Look familiar?
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Polynomial Interpolation}
\begin{itemize}
\item We solve
  \begin{align}
    \begin{bmatrix} 1 & x_{0} & x_{0}^{2} & ... & x_{0}^{n}\\
      \vdots & \vdots & \vdots & \vdots & \vdots \\
      1 & x_{n} & x_{n}^{2} & ... & x_{n}^{n}
      \end{bmatrix}\begin{bmatrix} a_{0}\\ \vdots \\ a_{n}\end{bmatrix} =
    \begin{bmatrix} y_{0}\\ \vdots \\ y_{n}
    \end{bmatrix}
  \end{align}
\item For $a_{0},...,a_{n}$
\item What's the example we are all familiar with? Linear regression: $y = \alpha + X\beta$.
\item In practice, this is computationally expensive, but this is the intuition.
\end{itemize}
\end{frame}

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

\section{Uncertainty} % 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{Great, we're done!}
\includegraphics[width=0.9\textwidth]{ThatWasEasy.jpg}
\begin{itemize}
\item Not so fast: how do we handle expected values?
\item Depends on expectation.
\item Need an accurate way to perform numerical integration.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Stochastic Neoclassical Growth Model}
\begin{itemize}
\item Problem:
  \begin{align}
    V(z,k) &= \max_{k'} u(c) + \beta E[V(z',k')]\\
    c + k' &= e^{z}F(k) + (1 - \delta)k\\
    z' &= \rho z + \epsilon\\
    \epsilon &\sim N(0,\sigma_{\epsilon})
  \end{align}
\item Assume power utility: $u(c) = \frac{c^{1 - \sigma} - 1}{1 - \sigma}$
\item Cobb-Douglas Production: $F(k) = k^{\alpha}$
\item Make sure your process for $z$ stays non-negative.
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Expectations with AR(1) Process}
\begin{itemize}
\item Approximate a continuous AR(1) process with a markov process:
\item Create grid of potential $z$ values $\{z_{1},...,z_{N}\}$, approximate AR(1) process through transition probabilities.
  \begin{align}
    E[z_{t}] &= E[\rho z_{t - 1} + \epsilon_{t}] = 0\\
    V[z_{t}] &= V[\rho z_{t - 1} + \epsilon_{t}] = \rho^{2}\sigma_{z}^{2} + \sigma_{\epsilon}^{2}\\
    \rightarrow (1 - \rho^{2})\sigma_{z}^{2} &= \sigma_{\epsilon}^{2}
  \end{align}
\item Define this process $G(\bar{\epsilon})$
\item Tauchen (1986):
  \begin{align}
    z_{N} &= m(\frac{\sigma_{\epsilon}^{2}}{1 - \rho^{2}})\\
    z_{1} &= -z_{N}\\
    z_{2},...,z_{N-1} &\text{   equidistant}
  \end{align}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Expectations with AR(1) Process}
\begin{itemize}
\item Tauchen (1986):
  \begin{align}
    z_{N} &= m(\frac{\sigma_{\epsilon}^{2}}{1 - \rho^{2}})\\
    z_{1} &= -z_{N}\\
    z_{2},...,z_{N-1} &\text{   equidistant}
  \end{align}
\item Create an $n x n$ transition matrix $\Pi$ using probabilities
  \begin{align}
    \pi_{ij} &= G(z_{j} + d/2 - \rho z_{i}) - G(z_{j} - d/2 - \rho z_{i})\\
    \pi_{i1} &= G(z_{1} + d/2 - \rho z_{i})\\
    \pi_{iN} &= 1 - G(z_{N} + d/2 - \rho z_{i})
  \end{align}
\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Expectations Generally}
\begin{itemize}
\item Expected values also need to be calculated carefully.
\item Continuation value from before:
  \begin{align}
    E[V(z,k')]
  \end{align}
\item If {\it not} an AR(1)/markov process, need to approximate integral.
\item Generically, pick function $f$ and weights $w_{i}$
  \begin{align}
    E[V(z,k')] = \int_{a}^{b}f(x)dx \approx \sum_{i = 1}^{N} w_{i}f(x_{i})
  \end{align}
\item $x_{i}$ may be known or picked optimally.
\item We will return to this in the future.
\end{itemize}
\end{frame}

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

\section{Conclusion}

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

\begin{frame}
  \frametitle{Next Time}
  \begin{itemize}
  \item Midterm!!
  \end{itemize}
\end{frame}


\end{document}
