[Soc2012-general] Proposal to work with python-statsmodels on Dynamic Linear Models

Bruno André Rodrigues Coelho r.c.bruno.andre at gmail.com
Sun Apr 1 22:10:03 CEST 2012



The main goal of this project is to extend python-statsmodels to
handle Dynamic Linear Models. These models are widely used in modern
econometrics, in particular in Macro-econometrics.
Some work has already been done by Wes McKinney available here:
https://github.com/wesm/statlib and as such most of the work I'll do
during the Gsoc will consist in updating his work
in order to make it part of python-statsmodels. Also, I'll take
inspiration of the dlm package from R, which is basically what we wish
to have in python-statsmodels. Finally, implementing the Kalman
Filter using Cython will also be part of this project.



Stasmodels lacks the needed tools to estimate DLMs and DSGE models and
economists around the world have been using mainly Matlab for it.
Estimation of such a model is done in different steps:
first the user has to solve a linear rational expectations model, and
then use the Kalman Filter to get its likelihood to be able to do
Bayesian inference. What I wish to do is make these functions
available in statsmodels so that the user only needs to specify the
matrices of the initial linear rational expectations model and then
get everything he needs (estimation of the model's parameters,
irfs, variance decomposition and so on). In the future (not in the
scope of this Gsoc), bringing Markov-Switching models is also planned.

However, estimating this kind of model takes a large amount of
computing power, so much of the code will need to be written in Cython
for maximum performance. Here is my week-by-week schedule:



Week 1 and 2: Get to know what has already been done; study statlib by
Wes McKinney and the dlm package. Also, read West & Harrison 1997.

Week 3: Debug and update statlib with my findings. Begin rolling it
out to statsmodels.

Week 4: Complete and finish my gensys implementation (gensys was
originally written by Christopher Sims in Matlab to solve linear
expectations models).

Week 4: Make gensys and the rest of statlib work well together.

Week 5-12: Work on the Kalman Filter. Details:

   Week 5-7: Get a basic filter working using Numpy
   Week 8-12: Port it to Cython for maximum performance

Week 13-14: Clean the code and write concise documentation.

Week 15: Summarize and define future work

About me:


I'm studying statistics and econometrics in France at Strasbourg University
and am writing my Master's Thesis on Markov-Switching DSGE models.
I'm a free software enthusiast and want to use Python for my future
research. I've been
using free software for some time now, and now want to give back too
and I think my best asset is my knowledge in Bayesian inference. To
get in touch with me:

r.c.bruno.andre at gmail.com


Rodrigues Bruno

More information about the Soc2012-general mailing list