Economics‎ > ‎

Codes, data, links, etc.

Computer programs I've written, some data, and links to sites (or people) I've found useful will go here.

Codes

Chebyshev collocation
Suite of programs for solving a model with EZ preferences, first-order risk aversion, habit formation and capital adjustment costs. Based on the approach described by Dario Caldara, Jesus Fernandez-Villaverde, Juan Rubio-Ramirez and Yao Wen in this paper.

For now, everything's in one big zip file: Risk-habit-paper-codes.zip.

Chain aggregation
Some code I use all the time is this simple Matlab function to calculate chain-aggregated price or quantity indices, given data on prices and real quantities for a collection of goods.
 
Download: fisher.m
 
Markov chain approximation of AR(1) processes
Here is Matlab code that implements Geert Rouwenhorst's method for approximating AR(1) processes with finite state Markov chains, from Geert's chapter in Cooley & Prescott (PDF available here; warning > 6MB).  Kopecky and Suen have a recent paper in RED vol. 13, arguing for the superiority of Rouwenhorst's method over the more commonly used Tauchen method, particularly when one wishes to approximate a highly persistent process.
 
Download: geert.m
 
(Non-economics) Find the date of Eastern Orthodox Easter for a given year
These are just a few lines of code that implement Gauss's algorithm for calculating the date Eastern Orthodox Easter falls on, for any given year (within some bounds, not binding for our lifetimes).
 
Note: A much more articulated Western Easter calculator is available here.  I like it especially for the following lines of code:
 
    L=Year-33;
    if L(L<0)
        error('Warning: There is not Easter before Crucifixion of Jesus')
    end
 
Download: easter.m

Data

Some data will go here, or at least links to some that I've had a hand in.  By and large, though, as I once heard a very prominent theorist say in a seminar, "I do most of my empirical work at the photocopier." For now, though, here is a favorite of mine, the Board of Governors' K.8 release: Holidays of the Federal Reserve System 2013-2017


Links

Software

There is so much high-quality open source software available these days. Here are some of my favorites:

TeXstudio - My favorite LaTeX editor. (I also like KDE's Kile,but it's buggy if you're running it on a Windows machine. It's great on Linux.)
Octave - Matlab is nice, but Octave is free!
Gretl - Great open source econometrics package
JabRef - A really nice BibTeX manager. I especially like its online search features (for example, you can search Google scholar for a reference and it will grab all the BibTeX fields for you). There is also a plugin that will allow you to push citations to TeXstudio (and other LaTeX front-ends).

Co-authors