Skip to content

ENH/Design module structure for IV, GMM, endogeneity #7691

Open

Description

@josef-pkt

so far we don't have any models that allow for endogenous regressors (outside of sandbox)

base GMM classes need to be somewhere central to avoid circular imports.

Models that handle endogenous regressors could either go in the directory that corresponds to the exogenous-only case, or we could add a separate folder for "endogeneity".

linearmodels package handles the linear case, we have additionally nonlinear and non-normal cases, e.g. with binary or count variables.

Full information MLE can be handled by two- or multi part or multi equation models.
We might still need separate classes to handle the presence of one endog as regressor of other endog, e.g. predict needs to be recursive or reduced form when we don't take value of auxiliary endog as given (e.g. is given if we predict effect of treatment if treatment==1, ATT)
-> recursive simultaneous versus multivariate models

IV, partial information treat some equations as auxiliary.
For the binary treatment case, we also have statsmodels.treatment as planned location. (case with conditional independence or whatever it is called, IPW instead of IV)

e.g. we have a design conflict in heckman class because it is both FIML and IV type.

GMMPoisson additive and multiplicative should be GMMExp because it only assumes exponential mean function. (Wooldridge: "IVPOIS should be called something like IVEXPON")
i.e. it's not specific to count distribution.
(But I guess we might want to specialize if we add optimal instruments.)

cases where at least one endog is discrete, binary/bernoulli, multinomial, count

  • binary or multinomial selection model: outcome only observed if selected is true, or for the selected choice
  • binary or multinomial regressor, outcome always observed
  • count variable with continuous endogenous regressors, e.g. case for control function, ivpoisson
  • bivariate Probit ?
  • ...

related: for general cases we will need something like MixedMixin for simulated MLE or quadrature (used in Cameron/Trivedi count book 2nd)

to get started

I guess a separate directory maybe simultaneous would be better so we can more easily share code between different models, e.g. for non-normal, nonlinear mean models in discrete and othermod.
endogenous or endogeneity is a difficult sell.
simultaneous however does not directly characterize IV methods, but we don't just have IVs.

In, the unlikely, case we get system of simultaneous equations, then they could be in system.
multivariate is for the purely exogenous cases (but multivariate is also linear)

What location for IV2SLS and LinearIVGMM?

Activity

  1. josef-pkt commented on Jan 24, 2022

    @josef-pkt
    MemberAuthor

    @bashtage
    Do you have a better suggestion for a directory name than statsmodels.simultaneous ?
    It should contain all models with endogenous regressors, both IV, GMM and MLE models including also non-normal distributions.

    (anything with "endogenous" is too much econometrics terminology)

  2. added this to the 0.14 milestone on Jan 24, 2022
  3. josef-pkt commented on Mar 17, 2023

    @josef-pkt
    MemberAuthor

    #8733 (comment)
    about whether we should add statsmodels.causal as umbrella folder.
    I'm slowly starting to become in favor of that.

  4. modified the milestones: 0.14, 0.15 on Mar 28, 2023
  5. josef-pkt commented on Apr 1, 2023

    @josef-pkt
    MemberAuthor

    linear ivgmm, iv2sls can go into causal
    special cases with predefined moment conditions like poissongmm can also go into causal
    generic gmm into base, class that needs user defined moment conditions (similar to GenericLikelihoodModel)

    unclear: IVGMM generic, i.e. super class for some nonlinear GMM with iv, could go in either base or as base class in causal

    Do we want a multicomponent IVGMM, i.e. several instruments * momcond horizontally stacked? (elementwise *)
    It would be useful for multi-equation models.
    It would be a special case for just stacking momconds as in treatment effect, but the later is also a special case if instruments is just a constant 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions