Skip to content

Commit

Permalink
Added week 13 materials and solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
wmutschl committed Feb 15, 2024
1 parent b4900d3 commit fe19b5b
Show file tree
Hide file tree
Showing 19 changed files with 1,713 additions and 41 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,11 @@ jobs:
with:
command: |
cd("progs/matlab")
BVARZLB_run
BVARZLB_run
- name: Run week 13 scripts
uses: matlab-actions/run-command@v1
with:
command: |
cd("progs/matlab")
rbcLogutilSSTest
rbcSSTest
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,15 @@ week_*_solution.tex
progs/matlab/BVARZLB_results_noZLB.log

progs/matlab/BVARZLB_results_withZLB.log

progs/dynare/\+rbcCES/

progs/dynare/\+rbcLogutil/

progs/dynare/rbcCES/

progs/dynare/rbcLogutil/

progs/dynare/rbcCES.log

progs/dynare/rbcLogutil.log
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,30 @@ Familiarize yourself with

</details>


<details>
<summary> Week 13: Introduction to DSGE models</summary>

### Goals

* understand the DSGE model framework, its basic structure and key challenges
* understand the algebra of a basic RBC model and of a basic New Keynesian model
* compute the steady-state of the RBC model with either MATLAB or Dynare


### To Do

* [x] Review the solutions of [last week's exercises](https://github.com/wmutschl/Quantitative-Macroeconomics/releases/latest/download/week_12.pdf) and write down all your questions
* [x] Read Fernandez-Villaverde, Rubio-Ramirez, and Schorfheide (2016, Ch.1) and Torres (2013, Ch. 1).
* [x] Read EITHER Gali (2015, Ch. 3) OR Heijdra (2017, Ch. 9) OR Romer (2019, Ch. 7) OR Woodford (2003, Ch. 3) OR Walsh (2017, Ch. 8)
* [x] Watch [Algebra of New Keynesian models](https://mutschler.eu/dynare/models/nk/)
* [x] Make note of all the aspects and concepts that you are not familiar with or that you find difficult to understand.
* [x] Do exercise sheet 13
* [x] If you have questions, get in touch with me via email or (better) [schedule a meeting](https://schedule.mutschler.eu)

</details>


## Content

We cover modern theoretical macroeconomics (the study of aggregated variables such as economic growth, unemployment and inflation by means of structural macroeconomic models) and combine it with econometric methods (the application of formal statistical methods in empirical economics). We focus on the quantitative aspects and methods for solving and estimating the most prominent model classes in macroeconomics: Structural Vector Autoregressive (SVAR) and Dynamic Stochastic General Equilibrium (DSGE) models. Using these two model strands, the theoretical and methodological foundations of quantitative macroeconomics is taught. The students are thus enabled to understand the analyses and forecasts of public (universities, central banks, economic research institutes) as well as private (business banks, political consultations) research departments, but also to derive and empirically evaluate their own structural macroeconomic models.
Expand Down
40 changes: 1 addition & 39 deletions exercises/_common_header.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,9 @@
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[dvipsnames]{xcolor}
\definecolor{mygreen}{rgb}{0,0.4,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
% \usepackage{listingsutf8}
% \lstset{language=Matlab, % Use MATLAB
% backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
% frame=leftline, % Single frame around code
% basicstyle=\footnotesize, % Use small true type font
% breaklines=true, % sets automatic line breaking
% breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
% captionpos=t, % sets the caption-position to bottom
% keywordstyle=[1]\color{Blue}\bfseries, % MATLAB functions bold and blue
% keywordstyle=[2]\color{Purple}, % MATLAB function arguments purple
% keywordstyle=[3]\color{Blue}\underbar, % User functions underlined and blue
% morekeywords={matlab2tikz,varobs,model,var,end,estimation,parameters,estimated_params,varexo,shocks,steady_state_model,check,steady,stoch_simul,stderr,corr,steady_state,initval},
% deletekeywords={beta,log,LOG,PI,pi,Pi,what}, % if you want to delete keywords from the given language
% identifierstyle=, % Nothing special about identifiers
% commentstyle=\usefont{T1}{pcr}{m}{sl}\color{mygreen}\small, % Comments small dark green courier
% stringstyle=\color{Purple}, % Strings are purple
% showstringspaces=false, % Don't put marks in string spaces
% showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
% showtabs=false, % show tabs within strings adding particular underscores
% tabsize=3, % 3 spaces per tab
% morecomment=[l][\color{Blue}]{...}, % Line continuation (...) like blue comment
% morecomment=[l]{//},
% morecomment=[s]{/*}{*/},
% %numbers=left, % Line numbers on left
% numberblanklines=false,
% firstnumber=1, % Line numbers start with line 1
% numberstyle=\tiny\color{mygray}, % Line numbers are lightgray
% numbersep=5pt, % how far the line-numbers are from the code
% numberbychapter=false,
% stepnumber=5, % Line numbers go in steps of 5
% escapeinside={(*@}{@*)}, % if you want to add LaTeX within your code
% keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
% rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
% title=\lstname, % show the filename of files included with \lstinputlisting; also try caption instead of title
% }
\usepackage[numbered,framed]{matlab-prettifier}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{literature/_biblio.bib}
Expand All @@ -61,9 +26,6 @@
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.text}
%\makeatletter
%\newcommand*{\currentname}{\@currentlabelname}
%\makeatother
\renewcommand{\contentsname}{Overview}

\usepackage[
Expand Down
22 changes: 22 additions & 0 deletions exercises/dsge_definition_challenges_structure.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
\section[DSGE Models: Definition, Key Challenges, Basic Structure]{DSGE Models: Definition, Key Challenges, Basic Structure\label{ex:DSGEModelsDefinitionChallengesStructure}}
\begin{enumerate}
\item Briefly define the term and key challenges of \textbf{D}ynamic \textbf{S}tochastic \textbf{G}eneral \textbf{E}quilibrium (DSGE) models.
What are DSGE models useful for?
\item Outline the common structure of a DSGE model.
How do Neo-Classical, New-Classical and New-Keynesian models differ?
\item Comment whether or not the assumptions underlying DSGE models should be as realistic as possible.
For example, a very common assumption is that all agents live forever.
\end{enumerate}

\paragraph{Readings}
\begin{itemize}
\item \textcite[Ch.~1]{Fernandez-Villaverde.Rubio-Ramirez.Schorfheide_2016_SolutionEstimationMethods}
\item \textcite[Ch.~1]{Torres_2013_IntroductionDynamicMacroeconomic}
\end{itemize}

\begin{solution}\textbf{Solution to \nameref{ex:DSGEModelsDefinitionChallengesStructure}}
\ifDisplaySolutions
\input{exercises/dsge_definition_challenges_structure_solution.tex}
\fi
\newpage
\end{solution}
125 changes: 125 additions & 0 deletions exercises/dsge_definition_challenges_structure_solution.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
\begin{enumerate}
\item DSGE models use modern macroeconomic theory to explain and predict co-movements of aggregate time series.
DSGE models start from what we call the micro-foundations of macroeconomics (i.e. to be consistent with the underlying behavior of economic agents),
with a heart based on the rational expectation forward-looking economic behavior of agents.
In reality all macro variables are related to each other, either directly or indirectly,
so there is no \enquote{cetribus paribus}, but a dynamic stochastic general equilibrium system.
\begin{itemize}
\item General Equilibrium (GE): equations must always hold.
\\
Short-run: decisions, quantities and prices adjust such that equations are full-filled.
\\
Long-run: steady-state, i.e. a condition or situation where variables do not change their value (e.g. balanced-growth path where the rate of growth is constant).
\item Stochastic (S): disturbances (or shocks) make the system deviate from its steady-state, we get business cycles or, more general, a data-generating process
\item Dynamic (D): Agents are forward-looking and solve intertemporal optimization problems.
When a disturbance hits the economy, macroeconomic variables do not return to equilibrium instantaneously,
but change gradually over time, producing complex reactions.
Furthermore, some decisions like investment or saving only make sense in a dynamic context.
We can analyze and quantify the effects after
(i) a temporary shock: how does the economy return to its steady-state, or
(ii) a permanent shock: how does the economy transition to a new steady-state.
\end{itemize}

Basic model structure:
\begin{align*}
E_t \left[f(y_{t+1}, y_t, y_{t-1},u_t)\right]=0
\end{align*}
where $E_t$ is the expectation operator with information conditional up to and including period $t$,
$y_t$ is a vector of endogenous variables at time $t$,
$u_t$ a vector of exogenous shocks or random disturbances with proper density functions.
$f(\cdot)$ is what we call economic theory.
\\
\textbf{First key challenge:} values of endogenous variables in a given period of time depend on future expected values.
We need dynamic programming techniques to find the optimality conditions which define the economic behavior of the agents.
The solution to this system is called a decision or \textbf{policy function}:
\begin{align*}
y_t = g(y_{t-1},u_t)
\end{align*}
describing optimal behavior of all agents given the current state of the world $y_{t-1}$ and after observing current shocks $u_t$.
\\
\textbf{Second key challenge}: DSGE models cannot be solved analytically, except for some very simple and unrealistic examples.
We have to resort to numerical methods and a computer to find an approximated solution.
\\
\textbf{third key challenge}: Once the theoretical model and solution is at hands, the next step is the application to the data.
A common procedure called calibration is assigning values to the parameters of the model
by using previous information or matching some key ratios or moments provided by the data.
More recently, researchers are commonly applying formal statistical methods to estimate the parameters using
maximum likelihood, Bayesian techniques, indirect inference, or a method of moments.

\item The dynamic equilibrium is the result from the combination of economic decisions taken by all economic agents.
For example, the following agents or sectors are commonly included:
\begin{itemize}
\item Households: benefit from private consumption, leisure and possibly other things like money holdings or state services;
subject to a budget constraint in which they finance their expenditures via (utility-reducing) work, renting capital and buying (government) bonds
$\hookrightarrow$ maximization of utility

\item Firms produce a variety of products with the help of rented equipment (capital) and labor.
They (possibly) have market power over their product and are responsible for the design, manufacture and price of their products.
$\hookrightarrow$ cost minimization or profit maximization
\item Monetary policy follows a feedback rule for either interest rates or money supply (growth).
For instance: nominal interest rate reacts to deviations of the current (or lagged) inflation rate from its target and of current output from potential output.

\item Fiscal policy (the government) collects taxes from households and companies
in order to finance government expenditures (possibly utility-enhancing) and government investment (possibly productivity-enhancing).
In addition, the government can issue debt securities.
\end{itemize}
There is no limitation, i.e. you can also add other agents and sectors like financial intermediaries (banks), international trade, research \& development, climate, etc.

\item Neoclassical or New-Classical models are basically the same terminology (unless you study economic history or really want to dive into the different school of thoughts).
Basically, both approaches focus on so-called \textbf{micro-foundations},
the one more in a classical sense (focus on real rigidities)
and the other more in a Keynesian sense (focus on nominal rigidities).
In principle this is already evident in the baseline RBC model and the baseline New-Keynesian model:
\begin{itemize}
\item RBC model is the canonical neoclassical model:
reduce economy to the interaction of just one (representative) consumer/household and one (representative) firm.
Representative household takes decisions in terms of how much to consume (save) and how much time is devoted to work (leisure).
Representative firm decides how much it will produce.
Equilibrium of the economy will be defined by a situation in which all decisions taken by all economic agents are compatible and feasible.
One can show that business cycles can be generated by one special disturbance:
total factor productivity or neutral technological shock;
hence, the model generates so-called real business cycles without nominal frictions.
Moreover, there is monetary neutrality in the model.
\item New-Keynesian models have the same foundations as New-Classical general equilibrium models,
but incorporate different types of rigidities in the economy.
Whereas new classical DSGE models are constructed on the basis of a perfect competition environment,
New-Keynesian models include additional elements to the basic model such as imperfect competitions,
existence of adjustment costs in investment process,
liquidity constraints or rigidities in the determination of prices and wages.
Due to these nominal rigidities there is no monetary neutrality in the short run.
Moreover, New-Keynesian models have become the leading macroeconomic paradigm.
\end{itemize}
Noth that the scale of DSGE models has grown over time with incorporation of a large number of features.
To name a few: consumption habit formation, nominal and real rigidities, non-Ricardian agents,
investment adjustment costs, investment-specific technological change, taxes, public spending, public capital, human capital,
household production, imperfect competition, monetary union, steady-state unemployment, green vs. brown production sector etc.

\item The degree of realism offered by an economic model is not a goal per se to be pursued by macroeconomists;
typically we are focused on the model's \textbf{usefulness} in explaining macroeconomic reality.
General strategy is the construction of formal structures through equations that reflect the interrelationships between the different economic variables.
These simplified structures is what we call a model.
The essential question is not that these theoretical constructions are realistic descriptions of the economy,
but that they are able to explain the dynamics observed in the economy.
Therefore, it is not possible to reject a model ex-ante because it is based on assumptions that we believe are not realistic.
Rather, the validations must be based on the usefulness of these models to explain reality, and whether they are more useful than other models.
Of course, most of the times unrealistic assumptions will yield non-useful models;
often, however, simplified assumptions that are a very rough approximation of reality yield quite useful models.
Either way, the DSGE model paradigm is up-front with our assumptions
and provide the EXACT model dynamics in terms of mathematical correct formulations that can be challenged, adapted and, ideally, improved.

Regarding the assumption that the lifetime of economic agents is assumed to be infinite:
We know that the lifetime of consumers, firms and governments is in fact finite.
Nevertheless, in most models this is a valid approximation of reality,
because for solving and simulating these models is is not important that agents actually live forever,
but that they use the infinite time horizon as \textbf{their reference period for taking economic decisions}.
Framed this way, the assumption becomes highly realistic.
Viewing at the economy from a macroeconomic point of view:
No government thinks it will cease to exist at some point in the future and
no entrepreneur takes decisions based on the idea that the firm will go bankrupt sometime in the future.
Granted, for consumers this is rather weak; however,, we may think about families, dynasties or households rather than individual consumers.
Again, the infinite time planning horizon assumption is a feasible one.
On the other hand, if you want to study the finite life cycle of an agent (school-work-retirement) or pension schemes,
the so-called Overlapping-Generations (OLG) framework is probably more adequate.
Either way, we need the same methods and techniques to deal with OLG models as we do with New-Keynesian models or RBC models,
because all these models belong to the same class, i.e. are all DSGE models.
\end{enumerate}
Loading

0 comments on commit fe19b5b

Please sign in to comment.