Tutorial Introduction

Tutorial Introduction#

DING Minjie, Spring 2025


This is tutorial notes for ECON 5360 “Monetary Economics” in Spring 2025.

This year, many students from Master of Economics program choose Research Preparation Concentration. Apart from regualr explanation of homework and exam, the tutorial section also covers this note, hope it will help you.

There must be errors and typos, please contact me at mdingaa@connect.ust.hk for errors.

MATLAB is primary language here. Python, Julia and Dynare is also used in some cases.


Contents#

  • Tutorial 1: Real Business Cycle Model in MATLAB, Dynare, Python and Julia

  • Tutorial 2: New Keynesian Model and Tractable Heterogeneity

  • Tutorial 3: Numerical Methods in MATLAB

  • Tutorial 4: Algorithm Comparison in Optimal Consumption Problem

  • Tutorial 5: From Optimal Consumption to Aiyagari Model

  • Tutorial 6: Aiyagari Model in Continous Time

  • Tutorial 7: Heterogeneous Agent NK model


Detailed Contents#

Tutorial 1: Real Business Cycle Model in MATLAB, Dynare, Python and Julia

  1. A Simple RBC Model Setting

  2. RBC Model in MATLAB

  3. Introduction to Dynare

  4. RBC Model in Dynare

  5. RBC Model with Occasional Binding

  6. RBC Model in Python

  7. RBC Model in Julia

Tutorial 2: New Keynesian Model and Tractable Heterogeneity

  1. Household

  2. Final goods firms

  3. Intermediate goods firms

  4. Policy and market clearing

  5. Equilibrium and steady state

  6. Dynare code for NK model

  7. Two-agent New Keynesian model

Tutorial 3: Numerical Methods in MATLAB

  1. Preparation for MATLAB

  2. Basic of MATLAB

  3. Graph

  4. Matrix Manipulation and Calculation

  5. Solve Nonlinear Equations/Root Finding

  6. Numerical Optimization

  7. Function Approximation with Interpolation

  8. Discretization

  9. Simulation

Tutorial 4: Algorithm Comparison in Optimal Consumption Problem

  1. A simple example to show computation difference

  2. Optimal Consumption Solution 1: Value Function Iteration using Loop

  3. Optimal Consumption with Income Shock

  4. Optimal Consumption Solution 2: Speed Up with Vectorization

  5. Endogenous Grid Method

  6. Optimal Consumption Solution 3: Speed Up with Endogenous Grid Method

Tutorial 5: From Optimal Consumption to Aiyagari Model

  1. A Basic Optimal Consumption Model using Endogenous Grid Method

  2. Extend to Stationary Equilibrium: Solve Aiyagari Model

Tutorial 6: Aiyagari Model in Continous Time

  1. Basic Idea in Continous Time

  2. Income in Ornstein-Uhlenbeck Process

  3. Evolution Matrix of Productivity (a Ornstein-Uhlenbeck Process)

  4. Evolution Matrix of Asset

  5. Hamilton–Jacobi–Bellman equation

  6. Kolmogorov Forward Equation/ Fokker-Planck Equation

  7. Income in Poisson Process