Quantitative Economics

Quantitative Economics is a new online text from John Stachurski and Thomas J. Sargent that looks phenomenal.

This website contains a sequence of lectures on economic modeling, focusing on the use of programming and computers for both problem solving and building intuition. The primary programming language used in the lecture series is Python, a general purpose, open source programming language with excellent scientific libraries.

…At this stage, the level of the lectures varies from advanced undergraduate to graduate, although we intend to add more elementary applications in the near future. The lectures are suitable for courses in quantitative methods and computational techniques, and also for self study and independent study groups. To aid self study, all exercises have solutions. Our solutions are not the last word on each exercise — instead they provide one approach that demonstrates good coding practices

If you work through the majority of the course and do the exercises, you will learn

  • how to analyze a number of fundamental economic problems, from job search and neighborhood selection to optimal fiscal policy
  • the core of the Python programming language, including the main scientific libraries
  • good programming style
  • how to work with modern software development tools such as debuggers and version control
  • a number of mathematical topics central to economic modeling, such as
  1. dynamic programming
  2. finite and continuous Markov chains
  3. filtering and state space models
  4. Fourier transforms and spectral analysis

I recommend you take the advanced undergraduate bit with a grain of salt.

Hat tip: Nathan Palmer.


When you say with a grain of salt, in which direction are you leaning? Is this more graduate level or 101?

1. Dynamic programming, 2. finite and continuous Markov chains, 3. filtering and state space models, 4. Fourier transforms and spectral analysis: golly, a reminder of things I once knew about.

Mind you, I learnt useful amounts about (1) and (4) as an undergraduate. But then, long ago, educational standards were higher.

Does "dynamic programming" involve a treadmill desk and a feather boa?

I just graduated and I learned decent amounts of 1, 2, and 4 (and briefly touched on 3) in my undergraduate education (econ/stat).

Most of this is high school material in any decent European country.

Yeah, I was doing Fourier analysis before Ptolemy made it cool.

In South Korea, they teach all this in kindergarten.


Yeah, I want to go to a high school that teaches Markov chains.

There are plenty of econ undergrads who could handle this stuff, e.g., https://economics.byu.edu/Pages/MacroLab/Boot-Camp.aspx

I'd say this "textbook" is closer to graduate level than undergraduate level. You need at least a semester of undergrad vector calc to understand the concepts which are just throw at you with little to no explanation. For example, the Markov chains are presented without much explanation beyond "because theorem".

It's defintietly a graduate level text - I covered topics like Dynamic Programming, Fourier, and Markov chains in my undergraduate (not the stuff about Kalmen filters though) but even so in this 'textbook' the authors just sort of throw things at the reader expecting people to instantly be able to recall/know all the background math. There really isn't much useful explanation for anything that I can see in this book, if you wanted to read it you would FIRST need to go get a bunch of other textbooks that covered a lot of the background material in more depth - and even then I'm not sure how much value this book adds. I agree with Andrew' below, this is a vanity project.

I mean something very specific. Impressing your colleagues by incentivizing the production of textbooks whose techniques are needed by 1% of the 1% of 1% and only then to impress your colleagues is what we do. Why do we do that?

You make it sound like these are niche techniques. Dynamic programming is as standard as it gets in macro, Markov chains are incredibly useful in all kinds of different fields, Kalman filters are standard in finance (and again, dozens of other fields), and Fourier transformations/spectral analysis is also standard time series stuff (though I haven't seen much economics work in the spectral domain).

The niche this textbook seems to try to fill is actually learning how to apply these methods using Python, a skill that I think is increasingly important. It's not for people who need to learn the math, it's for people who know the math but don't know how they might actually implement it computationally.

"it’s for people who know the math but don’t know how they might actually implement it computationally. "

To me this says that we are not as far apart as we may think.

Because chicks dig a man with math skills.

To me, "advanced undergrad to graduate" usually means that a fourth (or maybe third) year on an advanced track (often with a PhD as a goal) could handle the class. From a cursory glance that seems about right for the textbook, though you probably need to take a fairly specific curriculum to feel comfortable.

Wonderful. Now we have vanity textbooks.

Yes. See: http://www.amazon.com/Macroeconomics-N-Gregory-Mankiw/dp/1429218878/ref=sr_1_4?ie=UTF8&qid=1378302872&sr=8-4&keywords=mankiw

Yes and no for what I mean. No in that it sounds like that book is helpful. Yes in that how many people are really doing macroeconomics, not to mention are they doing us any good?

Per the comment below, I'm now of the opinion we create different departments so that professors can borrow from outside their discipline to impress those within their discipline. Maybe this is progress. I wish I could quantify how many of the products we use actually depend on this RCH-pecision math, but I don't have the math skills.

How is that a vanity textbook? That (well, an earlier edition, obviously) was my macro textbook as an undergrad. My understanding is it's one of the most widely used macro textbooks.

The material appears to be more Electrical Engineering (Systems) than Econ.

I was thinking that most of the underlining math was part of my coursework as an undergrad EE.

There's a reason that Physics undergrads make great Econ grad students.

Economists can model optimal fiscal policy? Don't keep it a secret, what is it!?

Here is a book that covers similar territory, but at a somewhat easier level. Here is a dissertation that uses Python to model public choice. Python FTW!

so you haven't been quantitative before ? maybe thats the problem with economics.

See above:

Ronald Coase September 4, 2013 at 8:11 am

I glanced at it, it strikes that the most of it should be comprehensible to undergrads with strong math backgrounds.

Starchurski has had most of these lectures on his website since 2009, as an appendix to his Macro/Computational textbook (which is good!) I'm not sure what Sargent is adding to this, but if it gets more macro people using Python, I'm for it.

They should cut out the python and scientific libraries introductions and put that out as a separate document. That part of it looks very well done, though it might be even better if they added some more advanced python stuff, like parallel processing or incorporating C code or other ways to speed things up.

They do recommend installing a Python package, specifically Anaconda. Anaconda comes with many modules, and Cython is one of them. I (obviously) have only glanced at the introduction of this text (having read about it today), but they did reference early on Python's processing limitations and there is a section in "About Python" that is entitled "interfacing with C and Fortran" to speed up your code in cases when necessary.

As a side note, because this is a comment discussing a programming language on an economics blog, I highly recommend the video entitled "The economy of programming languages" on Coursera's Compilers course.

Found here:


I have only read the introductory chapters, but they do recommend installing a Python package, Anaconda, which includes Cython (for incorporating C). Also in "About Python" there is a section entitled "Interfacing with C or Fortran". Maybe there is more to come in the text, but regardless, they point out this is something important to learn.

Isn't parallel processing out of place? What fraction of even professional Economists use parallel processing?!

A pretty small fraction since so many are stuck using old-fashioned tools like SAS that make it very hard to do. Since much of the "professional" economics being done involves pulling 10,000 samples of something and regressions or simulations, it would be helped a great deal by modern tools.

But I think the really big win would come from modern version control and debuggers.

Comments for this post are closed