Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH/DOC: GMM for panel data. Example/Tuto #7901

Open
JulietteOrtholand opened this issue Nov 24, 2021 · 3 comments
Open

ENH/DOC: GMM for panel data. Example/Tuto #7901

JulietteOrtholand opened this issue Nov 24, 2021 · 3 comments

Comments

@JulietteOrtholand
Copy link

JulietteOrtholand commented Nov 24, 2021

I am currently trying to use your GMM model, but I can't find any existing project, example or tuto about it. I saw you have done some notebook of example for other models, which is quite nice, thanks. Do you now if tutorial for GMM exist or if it would be possible to create one ?

Maybe there exist some example of GMM statsmodels use that I have not found, if so could you share them with me ? Otherwise, would it be possible to make a notebook for that as you made for other models in examples?

I am currently working on longitudinal (panel) data and I would like to better understand how GMM could apply to my work. Note that I found https://stackoverflow.com/questions/39008793/are-there-any-examples-for-statsmodels-gmm-generalized-method-of-moments , but it only seems to deal with crosssectional data.

Many thanks :)

@josef-pkt
Copy link
Member

We don't have an example of GMM with panel data, AFAIR
I have an old example of asset pricing CAPM https://nbviewer.org/gist/josef-pkt/6895915
AFAIR, all other examples are cross sections

Do you have a dynamic or static panel data model? short and wide panel or long panel? balanced or unbalanced?

The moment conditions will need to be stacked, but I'm not sure how easy that is for different panel types.
(Also not all robust cov_types are implemented for GMM. AFAICS, panel robust cov_types are missing.)

@JulietteOrtholand
Copy link
Author

Thank you for your quick answer. I will look carefully to your example and come back to you if needed.

I am working with dynamic panel data model and with long panel (medical patient visits). My datasets are unbalanced but I can start with a balanced subset of them.

Anyway, I'll come back to you soon and close the issue if everything is fine on my side. Is it ok for you ?

@josef-pkt
Copy link
Member

For the linear case, you can also look at Kevin's linearmodels package https://github.com/bashtage/linearmodels
AFAICS, GMM for panel data is still missing.

The main GMM class in statsmodels is "generic", but leaves all the work of setting up moment conditions to the user.

You can leave the issue open, and it would be great if you can tell us how it works for you or what's missing.

I didn't find a direct issue for this (although we discussed plans for the dynamic panel system gmm estimator on the mailing list)

@josef-pkt josef-pkt changed the title Example/Tuto of GMM use ENH/DOC: GMM for panel data. Example/Tuto Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants