Hello list,I am new to statsmodels (and development) and would like to contribute if I can. I am working on a non-linear GMM paper and can't find the code within the statsmodels module (nor can I seem to load it into python). Is this because the code is not there? Was the GMM class ever finished? If so, could someone direct me to the source in the file tree? If not, does anyone know where this project stands currently and what a good starting point would be to contribute?
On Sat, Jun 6, 2015 at 5:53 AM, <tyler...@sciencespo.fr> wrote:Hello list,I am new to statsmodels (and development) and would like to contribute if I can. I am working on a non-linear GMM paper and can't find the code within the statsmodels module (nor can I seem to load it into python). Is this because the code is not there? Was the GMM class ever finished? If so, could someone direct me to the source in the file tree? If not, does anyone know where this project stands currently and what a good starting point would be to contribute?Thank Tyler, getting a new contributor in this area would be great.documentation and some example notebooks are heredata for the notebooks https://gist.github.com/josef-pkt/8128539 https://gist.github.com/josef-pkt/8128535I'm not sure the notebooks are for the latest version that is in master.
If you are interested in the development detailshere is the merged PR https://github.com/statsmodels/statsmodels/pull/1105with some comments from my last round when I worked on itand there are a few open issuesfor example adding more models that use GMMthe test suite also has more examples used as test casesThe GMM classes are finished in the sense of they are working and have a good set of unit tests against Stata.
However, there remains a lot to be done, since GMM is a huge topic.roughly, the tasks that are still left1) write more models on top of the current GMM class(es)2) review usability and user interface3) more post estimation tools and hypothesis/diagnostic tests4) internal refactoring5) extension to different data structures.to 1)I think this is the best way to get started with GMM. If you have a group of models for your work that use GMM, then it should be "reasonably straightforward" to use the current classes.Essentially, the GMM base classes should go into statsmodels.base and provide similar to LikelihoodModel a generic estimation class. But we need to write specific models on top of it to make it directly usable.The IVGMM classes are written as special cases for models that can be put into linear or linear IV moment conditions.to 3)This is one of the areas that I was looking at after I finished my last round but didn't write much code, and I don't have a good overview.One area that I had tried to figure out was to add support and tests for the many weak instrument case.Anotherto 4)This is mainly for me to get back to sandwich robust covariance matrices. I had written the sandwiches for GMM before adding them to the other models, and I haven't gone back to reuse the same code and patterns across GMM and the other models.
Hi Josef,I'm actually working on something very similar to the Hansen and Singleton example you provide. I'm a little puzzled though by your results. Where did you get the data? The CRRA parameter should be positive, otherwise the preferences are risk loving => preferences are convex and exhibit increasing marginal utility. I've messed with the example for a bit and it seems to be fine, so I guess you generated the data?
I will work on my problem to get acquainted with the module and maybe work on the documentation for the gmm classes as I go. It can be difficult to find source and determine what does what. Along with that, whatever tests/analysis not already included which I write for myself I will push for the module. When I'm done I could add my model to the classes (if it turns out to be any different from what is already there).With those I would hit on 1-3 of your points. I am interested in dynamic panel data models, so if I do anything related to this I will be sure to propose it for the module.
Sound good?
On Sat, Jun 6, 2015 at 11:36 AM, <tyler...@sciencespo.fr> wrote:Hi Josef,I'm actually working on something very similar to the Hansen and Singleton example you provide. I'm a little puzzled though by your results. Where did you get the data? The CRRA parameter should be positive, otherwise the preferences are risk loving => preferences are convex and exhibit increasing marginal utility. I've messed with the example for a bit and it seems to be fine, so I guess you generated the data?I think the data are a standard dataset for the consumption. The example is based mostly on some online explanation or lecture notes and on the stata manual, e.g. http://www.stata.com/manuals13/rgmm.pdf p. 34 where gamma is also estimated as negative.Maybe it shouldn't be called CRRA if it is defined with the wrong sign.I haven't done macroeconomics in a very long time, and didn't try to "understand" the Hansen-Singleton model again. It was just a example for me.corrections are welcome
I will work on my problem to get acquainted with the module and maybe work on the documentation for the gmm classes as I go. It can be difficult to find source and determine what does what. Along with that, whatever tests/analysis not already included which I write for myself I will push for the module. When I'm done I could add my model to the classes (if it turns out to be any different from what is already there).With those I would hit on 1-3 of your points. I am interested in dynamic panel data models, so if I do anything related to this I will be sure to propose it for the module.
Sound good?Sounds good.What would also be very useful from an application viewpoint are additional functions or methods to interpret the results. You might have a better idea based on the subject than I do.We had a GSOC proposal last year for System-GMM (Arellano, Bond and related) but, unfortunately, lost the student to an internship at an international organization.Implementing the full System GMM is, I think, quite a large project, but there might be versions that don't use the full set of moment conditions that are more "digestible".