Code

This page contains Julia code to solve various economics and finance problems that I have written over the years.

This code is provided “as is” without warranty of any kind, express or implied. While efforts have been made to ensure accuracy, all errors or omissions are my own.

Any comments, suggestions, and corrections are welcome and can be emailed to terryhanjokim@gmail.com.

Local methods

This code translates Schmitt-grohe and Uribe’s Matlab codes to log-linearize and solve models to Julia. In particular, I use SymEngine to symbolically differentiate first-order conditions and uses lambdify to quickly evaluate them numerically.

Package: SGU.jl

Examples:

Global methods:

Three ways to solve the income fluctuation problem.

Portfolio Optimization:

Solve for the optimal portfolio that minimizes variance subject to a short-selling constraint using both the Monte Carlo method and the root-finding method.