Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Test with nbval
shell: bash -l {0}
run: |
python -m pytest --nbval-lax --nbval-cell-timeout=12000 --ignore=notebooks/Chinese-Growth.ipynb --ignore=notebooks/Harmenberg-Aggregation.ipynb notebooks/
python -m pytest --nbval-lax --nbval-cell-timeout=12000 --ignore=notebooks/Chinese-Growth.ipynb --ignore=notebooks/Harmenberg-Aggregation.ipynb --ignore=notebooks/The-Prescott-Real-Business-Cycle-RBC.ipynb notebooks/
3 changes: 3 additions & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ dependencies:
- linearmodels
- tqdm
- nbval
- matplotlib
- statsmodels
- scipy
- pip
- pip:
- git+https://github.com/econ-ark/hark@master
21 changes: 21 additions & 0 deletions markdown/DSGE-RA-K-Dynamics-Problems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: DSGE-RA-K-Dynamics-Problems
tags:
- DemARK
- Demonstration
- Teaching
- Notebook
abstract: 'Capital dynamics exercises for a representative-agent stochastic growth model.'
authors:
-
family-names: Carroll
given-names: "Christopher D."
orcid: "https://orcid.org/0000-0003-3732-9312"
github_repo_url: https://github.com/econ-ark/DemARK
notebooks:
-
notebooks/DSGE-RA-K-Dynamics-Problems.ipynb
dashboards:
---

Capital dynamics exercises for a representative-agent stochastic growth model.
24 changes: 24 additions & 0 deletions markdown/RamseyCassKoopmans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: RamseyCassKoopmans
tags:
- DemARK
- Demonstration
- Notebook
abstract: 'Implements the Ramsey/Cass-Koopmans growth model using the time-elimination solution method.'
authors:
-
family-names: Velasquez-Giraldo
given-names: "Mateo"
orcid: "https://orcid.org/0000-0001-7243-6776"
-
family-names: Carroll
given-names: "Christopher D."
orcid: "https://orcid.org/0000-0003-3732-9312"
github_repo_url: https://github.com/econ-ark/DemARK
notebooks:
-
notebooks/RamseyCassKoopmans.ipynb
dashboards:
---

Numerical solution, phase diagram, and simulations for the Ramsey/Cass-Koopmans growth model.
20 changes: 20 additions & 0 deletions markdown/The-Prescott-Real-Business-Cycle-RBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: The-Prescott-Real-Business-Cycle-RBC
tags:
- DemARK
- Demonstration
- Notebook
abstract: 'Sets up, solves, and estimates the Prescott Real Business Cycle model.'
authors:
-
family-names: Carroll
given-names: "Christopher D."
orcid: "https://orcid.org/0000-0003-3732-9312"
github_repo_url: https://github.com/econ-ark/DemARK
notebooks:
-
notebooks/The-Prescott-Real-Business-Cycle-RBC.ipynb
dashboards:
---

Setup, solution, and estimation workflow for the Prescott Real Business Cycle model.
210 changes: 210 additions & 0 deletions notebooks/DSGE-RA-K-Dynamics-Problems.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Capital Dynamics in a Stochastic Growth Model\n",
"\n",
"[![badge](https://img.shields.io/badge/Launch%20using%20-Econ--ARK-blue)](https://econ-ark.org/materials/dsge-ra-k-dynamics-problems#launch)\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The handout [BrockMirman](http://econ.jhu.edu/people/ccarroll/public/lecturenotes/DSGEmodels/BrockMirman) derived some facts about a special case of a representative agent DSGE model where analytical results can be obtained. This exercise asks you to explore this model and closely related ones further, numerically, by adapting tools from the [QuantEcon](https://lectures.quantecon.org/py/) treatment of [optimal growth](https://lectures.quantecon.org/py/optgrowth.html) (you should download their Jupyter notebook to get a start)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## PROBLEM\n",
"## Calculate theoretical variance of $k$\n",
"The handout shows that if the productivity shocks $\\phi_{t}$ are iid and have variance $\\sigma^{2}_{\\phi}$ then\n",
"\n",
"<!-- $\\newcommand{\\var}{\\text{var}}$ -->\n",
"\n",
"$$\n",
"\\begin{align}\n",
"k_{t+1} & = & \\log \\alpha \\beta + \\alpha k_{t} + \\phi_{t}\n",
"\\end{align}\n",
"$$\n",
"\n",
"Show that this implies that the variance of $k$ is \n",
"$$\n",
"\\begin{align}\n",
" \\var(k) & = & \\frac{\\sigma^{2}_{\\phi}}{1-\\alpha^{2}}\n",
"\\end{align}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PROBLEM\n",
"## Simulate the economy and calculate $\\var(k)$\n",
"\n",
"Now using the QuantEcon tools, simulate the economy under the baseline parameter values and show that your simulation results correspond to the theoretical result"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PROBLEM\n",
"## Suppose $\\phi_{t}$ is serially correlated\n",
"\n",
"Now we want to consider a case where the level of productivity $\\epsilon$ is serially correlated:\n",
"\n",
"$$\n",
"\\begin{align}\n",
"\\phi_{t} = \\zeta \\phi_{t-1} + \\nu_{t}\n",
"\\end{align}\n",
"$$\n",
"\n",
"for some shock $\\nu$ with variance $\\sigma^{2}_{\\nu}$ and a serial correlation coefficient $0 < \\zeta < 1$. Calculate the variance of $k$ under this new assumption."
]
},
{
"cell_type": "markdown",
"metadata": {
"heading_collapsed": true
},
"source": [
"# PROBLEM\n",
"## Now Solve and Simulate the Model\n",
"\n",
"Use the tools provided on the QuantEcon website to solve the model. Then, starting with a capital stock equal to the stochastic steady state, simulate the model for 100 periods five separate times. Compare the variances you have calculated numerically to the formulas you derived analytically, and make some remarks about what this means for trying to calibrate the model to data by examining the variance of $k$ in empirical data."
]
},
{
"cell_type": "markdown",
"metadata": {
"heading_collapsed": true,
"hidden": true
},
"source": [
"## Now Do a Similar Exercise for the CRRA utility Model\n",
"\n",
"Use the QuantEcon code to solve the model for a value of relative risk aversion $\\rho = 3$. Now calculate the variance of $k$ for this new model in the same way you did for the earlier model. \n"
]
},
{
"cell_type": "markdown",
"metadata": {
"hidden": true
},
"source": [
"## Compare the Results to a linearized approximation\n",
"\n",
"Now numerically confirm the result from the BrockMirman handout that \n",
"\n",
"$$\n",
"\\begin{align}\n",
" y_{t+1} & = & \\alpha (y_{t} + \\log \\alpha \\beta ) + \\phi_{t+1}\n",
"\\end{align}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {
"hidden": true
},
"source": [
"Simulations go here"
]
},
{
"cell_type": "markdown",
"metadata": {
"hidden": true
},
"source": [
"To develop the rest of this problem, see the corresponding question DSGE-RA-K-Dynamics-Problems-and-Solutions. In particular, need to plot the phase diagram and show how the consumption function changes with $\\rho$."
]
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,py:percent",
"text_representation": {
"extension": ".py",
"format_name": "percent",
"format_version": "1.1",
"jupytext_version": "0.8.3"
}
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
"autoclose": false,
"autocomplete": true,
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 1,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
},
"labels_anchors": false,
"latex_user_defs": false,
"report_style_numbering": false,
"user_envs_cfg": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading