MATLAB, Python, Julia: What to Choose in Economics

Working Paper: CEPR ID: DP13210

Authors: Chase Coleman; Spencer Lyon; Lilia Maliar; Serguei Maliar

Abstract: We perform a comparison of Matlab, Python and Julia as programming languages to be used for implementingglobal nonlinear solution techniques. We consider two popular applications: a neoclassicalgrowth model and a new Keynesian model. The goal of our analysis is twofold: First, it is aimed at helpingresearchers in economics to choose the programming language that is best suited to their applicationsand, if needed, help them transit from one programming language to another. Second, our collectionsof routines can be viewed as a toolbox with a special emphasis on techniques for dealing with high dimensionaleconomic problems. We provide the routines in the three languages for constructing randomand quasi-random grids, low-cost monomial integration, various global solution methods, routines forchecking the accuracy of the solutions, etc. Our global solution methods are not only accurate but alsofast. Solving a new Keynesian model with eight state variables only takes a few seconds, even in thepresence of active zero lower bound on nominal interest rates. This speed is important because it thenallows the model to be solved repeatedly as one would require in order to do estimation.

Keywords: toolkit; MATLAB; Python; Julia; dynamic programming; global solution; nonlinear; high dimensionality; large scale; value function iteration

JEL Codes: C6; C61; C63; C68; E31; E52


Causal Claims Network Graph

Edges that are evidenced by causal inference methods are in orange, and the rest are in light blue.


Causal Claims

CauseEffect
programming language choice (C88)computational speed (C63)
programming language choice (C88)computational accuracy (C63)
julia (Y70)computational speed (C63)
MATLAB and Python (C88)computational speed (C63)
programming language choice (C88)performance for some algorithms (C69)

Back to index