Open josef-pkt opened 3 years ago
One problem for multi-link model is that we have different exog with inconsistent names across models. We need to find a way to specify which link/exog gets the exog_xxx_extra.
I guess we need to delegate some parts to the specific model. The variable addition usecase is important enough to do some extra work for it.
I guess, we will have a similar problem extending fit_constrained
to multi-link, multi-exog models if we follow the current pattern of exog transformation. (maybe switching to constrained optimizers will be simpler)
Also, using the transformation approach does not allow "cross-equation" restrictions when we have multiple exog
another design question: Do we append extra score/hess at the end or insert next to model exog_xxx? I guess inserting is easier if we reuse or follow the pattern of model score_obs and hessian. Appending at the end would be more useful when we split into new and old moment conditions.
reference and comments on generalized residuals (score_factor) https://github.com/statsmodels/statsmodels/issues/7897#issuecomment-1514888372
add score
My current score_test for models has two versions
fit_constrained
which currently does not work for models with extra params or multi-links.Models with extra params that are constant, e.g. NegBin and GPP We need to extend score_test for the mean model. However, If the constant extra-params case is the null model, then we could test exog dependent, varying parameter as in the multi-link case.
Multi-link models: Models with exog dependent dispersion or
scale
, BetaModel and #7793 One possible specification test is testing that scale (extra params) is constant, i.e. coefficients of (slope) explanatory variables are zero. Implementation would need to handle multiple score_factors and hessian_factors.Multi-part models: e.g. zero-inflation which uses internally two submodels to delegate to. Possible specification test: constant versus varying, exog-dependent zero-inflation. Implementation may be able to delegate to submodels.
7597 includes specification test for poisson about poisson versus zero-inflated or zero-modified poisson