Repository navigation
Description
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
- heckman in PR Heckman rebased #7636
- GMMExp in sandbox
- count with control function for continuous regressors ENH: GLM, discrete with endogenous regressors, control functions #7689 (looks relatively easy)
treatmentclean up GMM with IPW
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
josef-pkt commentedon Sep 5, 2021
related: I have not looked at those yet.
Using copulas to handle bivariate cases
https://doi.org/10.1002/jae.2727
https://doi.org/10.1007/s11222-015-9581-6
https://doi.org/10.1002/hec.1801
https://doi.org/10.1287/mksc.1120.0718
related:
#7642 bivariate binary
#7312 heckprobit
josef-pkt commentedon Jan 24, 2022
@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)
josef-pkt commentedon Mar 17, 2023
#8733 (comment)
about whether we should add
statsmodels.causalas umbrella folder.I'm slowly starting to become in favor of that.
josef-pkt commentedon Apr 1, 2023
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
baseor as base class incausalDo we want a multicomponent IVGMM, i.e. several
instruments * momcondhorizontally 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.