All Projects → zhouweimin-econ → QuantMacro

zhouweimin-econ / QuantMacro

Licence: other
2018-2019 Quantitative Macroeconomics, UAB

Programming Languages

matlab
3953 projects
TeX
3793 projects

Projects that are alternatives of or similar to QuantMacro

Lab.js
Online research made easy
Stars: ✭ 140 (+174.51%)
Mutual labels:  economics
wikirepo
Python based Wikidata framework for easy dataframe extraction
Stars: ✭ 33 (-35.29%)
Mutual labels:  economics
Nowcasting
Nowcasting
Stars: ✭ 162 (+217.65%)
Mutual labels:  economics
Books
Books worth spreading
Stars: ✭ 161 (+215.69%)
Mutual labels:  economics
lecture-python.myst
Quantitative Economics with Python
Stars: ✭ 49 (-3.92%)
Mutual labels:  economics
py-ecomplexity
Python package to compute economic complexity and associated variables
Stars: ✭ 46 (-9.8%)
Mutual labels:  economics
Fixedeffectmodels.jl
Fast Estimation of Linear Models with IV and High Dimensional Categorical Variables
Stars: ✭ 132 (+158.82%)
Mutual labels:  economics
lecture-julia.myst
Lecture source for "Quantitative Economics with Julia"
Stars: ✭ 24 (-52.94%)
Mutual labels:  economics
housing-model
Agent-based model of the UK housing market.
Stars: ✭ 29 (-43.14%)
Mutual labels:  economics
mxfactorial
a payment application intended for deployment by the united states treasury
Stars: ✭ 36 (-29.41%)
Mutual labels:  economics
Microeconometrics.jl
Microeconometric estimation in Julia
Stars: ✭ 30 (-41.18%)
Mutual labels:  economics
inquisitor
Python Interface to econdb.com API
Stars: ✭ 31 (-39.22%)
Mutual labels:  economics
BeaData.jl
A Julia interface for retrieving data from the Bureau of Economic Analysis (BEA).
Stars: ✭ 17 (-66.67%)
Mutual labels:  economics
Rtutor
Creating interactive R Problem Sets. Automatic hints and solution checks. (Shiny or RStudio)
Stars: ✭ 141 (+176.47%)
Mutual labels:  economics
VFIToolkit-matlab
A Matlab Toolkit for Macroeconomic Models using Value Function Iteration
Stars: ✭ 59 (+15.69%)
Mutual labels:  economics
Appelpy
Applied Econometrics Library for Python
Stars: ✭ 136 (+166.67%)
Mutual labels:  economics
edgar-crawler
Download financial reports from SEC's EDGAR. Extract clean textual data from specific item sections and bootstrap your financial NLP research. Software from the research paper published in ECONLP 2021.
Stars: ✭ 71 (+39.22%)
Mutual labels:  economics
value-investing-studies
Data Analysis Studies on Value Investing
Stars: ✭ 66 (+29.41%)
Mutual labels:  economics
EconData
R package containing a host of datasets useful for economic research. Complete with raw data and cleaning functions.
Stars: ✭ 28 (-45.1%)
Mutual labels:  economics
PatCit
Making Patent Citations Uncool Again
Stars: ✭ 84 (+64.71%)
Mutual labels:  economics

Quantitative Macroeconomics, 2018-2019

Economics PhD 2nd Year Course, UAB

Intro

Our course is separated into two parts.

Part A is from basic numerical methods to solution of Representative Agent Models (permanent income, life-cycle) with VFI, PFI; and eventually going to Heterogenous Agents with Incomplete Markets. In the end, we need to solve Recursive Stationary Equilibrium of the Aiyagari-Bewley-Hugget-Imrohoroglu (ABHI) Model.

Part B accesses to Krusell and Smith (1998) model (Heterogenous agents, incomplete markets and aggregate uncertainty), and defaultable sovereign debt.

Background Readings:

Textbook Reference:

Similar Course:

Quantitative Economics, NYU by Gianluca Violante


Main Strategies of solving our models:

1. conventional Value Function Iteration (VFI) and Policy Function Iteration (PFI)

VFI and PFI is the well-known basic algorithms of dynamic programming.

For Discretization, we practiced evenly-spaced grids, chebyshev polynomials (finer grids yield better approximations but are costly in terms of computer time, for algorithm containing numerical optimization and root-finding, Matlab performs worse than Python and Julia)

In our course, VFI and PFI are implemented by brute-force iteration of value function given discrete state space. Similar way could calculate decision variable by fminbnd (i.e. kp = fminbnd(@valfun,kmin,kmax); ), where since “fminbnd” assumes a continuous choice set, basically it will search over all values of kp between “kmin” and “kmax”, which will include points not in the original capital grid. For this reason, we need to interpolate values of the value function off of the grid. (i.e. g = interp1(kmat,v0,k,'linear'); val= utility(c) + beta*g;):

while dif>tol & its<maxits
   for i = 1:N
      k0 = kmat(i,1);
      k1 = fminbnd(@valfun,kmin,kmax);
      v1(i,1) =−valfun(k1);
      k11(i,1) = k1;
   end
   dif = norm(v1−v0);
   v0 = v1;
   its = its+1
end

for i = 1:N
   con(i,1) = kmat(i,1)ˆ(alpha)−k11(i,1) + (1−∆)*kmat(i,1);
   polfun(i,1) = kmat(i,1)ˆ(alpha)−k11(i,1) + (1−∆)*kmat(i,1);
end

Where the value function for a neoclassical growth model with no uncertainty and CRRA utility are calculated by interpolation.

function val=valfun(k)

global v0 beta ∆ alpha kmat k0 s

g = interp1(kmat,v0,k,'linear'); % smooths out previous value function

c = k0ˆalpha−k + (1−∆)*k0;       % consumption
if c≤0
   val =−9999−999*abs(c); % keeps it from going negative
else
   val=(1/(1−s))*(cˆ(1−s)−1) + beta*g;
end

val = −val; % make it negative since we're maximizing and code is to minimize.

eg.1: See Part_A/PS4-solution where we practiced VFI and PFI using a couple of improvements to speed up (e.g., concavity of value function, previous solution, monotonicity of decision rules).

eg.2: See Part_B/PS1-solution/main.m, which I use VFI associated with KS algorithm for solving Krusell and Smith model (~300 minutes MATLAB).

Costs and benefits of VFI and PFI: simple and have a solution for sure, but slow and inaccurate.

Some extensions:

  • Euler Equation iteration

EEI is faster than VFI (still pretty slow), but much more accurate. For EEI, we update policy function with Euler Equation.

  • Endogenous Gridpoints Methods

similar to EEI, but avoid solving non-linear equations.

eg.1: Christopher Carroll’s endogenous gridpoint method

2. Perturbation method (for more details, go to Part_B/Final Project )

Perturbation method (local) approximate the policy function around the no uncertainty case, and this can deal with large problems but require model equations be differentiable, hence, cannot deal perfectly with zero lower bound and occasionally binding constraints.

To approximate the policy function, we could apply 1st-order taylor expansion, or higher-order, and some more recent resources from Matlab toolbox, the "Automatic Differentiation" method.

eg.1: Perturbation methods of solving Krusell&Smith(1998): Solving the Incomplete Markets Model withAggregate Uncertainty Using a Perturbation Method. Kim, Kim, and Kollmann.

eg.2 (can be <10 seconds MATLAB): with the borrowing constraint replaced by a penalty function and the finite-state Markov process replaced by a stochastic process with continuous support; or the most recent work done by Christian Bayer, "Solving heterogeneous agent models in discrete time with many idiosyncratic states by perturbation methods", (with Ralph Luetticke), July 2018, CEPR DP No. 13071, MALTAB code

3. Projection methods (for more details, go to Part_B/Final Project )

eg.1: parameterization of the cross-sectional distribution: do not obtain next period's cross-sectional moments by simulation techniques,but by explicitly integrating the individual choices;

eg.2: no parameterization of the cross-sectional distribution: derives the aggregate laws of motion directly from the individual policy rules by simply aggregating them;

4. Linearization

We learned this method during our Macro II by using Dynare, billions of resources could be found via Internet.


Advanced Extensions

Perturbation + Projection methods:

I will replicate this method in my Final Project of Unit 2.

A guide to understand different methods on solving K&S model and comparisons of different solution methods to solve K&S model: Comparison of solutions to the incomplete markets model with aggregate uncertainty. Wouter den Haan

eg.1: Reiter Michael, 2009. "Solving heterogeneous-agent models by projection and perturbation," Journal of Economic Dynamics and Control, Elsevier, vol. 33(3), pages 649-665, March.

eg.2: Thomas Winberry, 2018 forthcoming. "A Method for Solving and Estimating Heterogeneous Agent Macro Models," Quantitative Economics


Parameterized Expectations Algorithm (PEA)

Explicit Aggregation (Xpa)

Euler Equation iteration with projection methods

...

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].