Repository navigation
ENH: Glm add score_obs - #1781
Conversation
|
@kshedden In my last commit I added a score_test. I haven't verified it yet against R, but it should roughly be a pattern that should work across models, (at least for cases where we can get score and hessian for new exog without creating a new model). It can take either a constrained parameter, or add additional exog variables to the score to test for omitted variables. |
|
Great. I will look this over. Hopefully we can make this (and your In the case of GEE, we would override the score test method because GEE is PHreg can probably use your score test code as-is. The wrinkle with PHreg It would be nice to get my constrained fitting code out of GEE for Constrained fitting in MixedLM is more complicated because there are On Tue, Jun 24, 2014 at 11:57 PM, Josef Perktold [email protected]
|
|
We are going to work slowly to a pattern that will be generic enough, or different patterns to apply to most models. One extension for GLM will be to take different (over/under dispersed) scale estimation into account, and the extra parameters for negative binomial and gamma. Another extension is to use auxiliary regression based on the residuals for score/LM tests diagnostic tests. I started to look at those for discrete.Poisson, but they will apply in the same/similar way for GLM and others. Another extension for GLM now that score and Hessian are available is to add scipy optimizers as fitting methods, both SAS and Stata use Newton-Raphson as default optimizer (I'm not completely sure it's the default in SAS or just an option). My plan is to go back to robust covariances and finish connecting them to the models (now including GLM), after looking at some issues and PRs. |
|
I'm pretty much done here. The only thing I'm still unsure is whether scale is handled correctly in Also, score_test returns (stat, pvalue, df) instead of a results instance. |
|
rebased and force pushed |
|
merging this todo follow-up: use analytic instead of numeric derivatives |
ENH: Glm add score_obs
so far just adds analytic (glm generic) score_factor and score_obs
see #1775 for score_factor
usage
#1753 score/LM test
#1738 robust cov
related #1726 generic numerical derivatives in LikelihoodModel
score_factor is the same as score residuals in Stata.
I checked some examples against Stata, but unittests are against discrete and OLS/explicit
add Hessian, observed and expected (information matrix) should be relatively easy to add, but not yet done. DONE
hackish: problems in varfunc and numdiff (need to open two issues)
uses numerical derivatives in varfunc and links, should be replaced with analytical derivatives
added score_test to model, not yet to results, maybe it only stays at the model.