Repository navigation
Description
there are several issues open for robust covariances:
specific here a comparison to Stata for possible options
related issues:
#44 add cov_p as argument to f_test and t_test, closed
#276 replacing cov inplace or create new instance or choose in fit()
#1418 and PR #1867 and #1870 add cov_type to fit method
#1922 followup issue to #1870 for details of interface in fit (and other todos)
model specific issues:
#1738 GLM (reference, and score_obs)
#1074 add robust cov to WLS (and others) (includes references)
#1095 robust cov for QMLE, #1750 same question GLM related
#863 (cluster) robust for MLE models
#1209 HCx after WLS, definition of hatmatrix
#1906 and PR #1916 GEE refactoring cov_type to fix a bug, should be refactored to follow same pattern
#1104 fvalue is wrong with unspecified heteroscedasticity - replaced by Wald test
llnull likelihood ratio test for nonzero slope coefficients not yet replace by Wald test
#1016 refactor into cached attributes (among unrelated issues)
cov_types
which types of robust covariance matrices do we support,
Besides those currently in statsmodels.stats.sandwich_covariance:
- Poisson maybe others needs a special case: overdispersed, only scale is misspecified
ivreg2documentation also mentionsACi.e. HAC without H, only autocorrelation robust.
not sure ivreg2 allowsbw(#)androbust bw(#)- xtpcse uses in one case something similar to SUR see more panel robust, contemporaneous correlation xtpcse #1207
- HC4 ?
- CR0, CR1, ... ? see revisit robust covariance, standard errors (cluster, spatial) #1099
Stata
regress uses HC1 by default after robust
ivreg2 uses HC1 with option small and HC0 without small
regress robust and ivreg2 small use t distribution in parameter table
ivreg2 default (without small) uses normal distribution in parameter table
reference for generic MLE sandwiches
U:20.21.2 Correlated errors, other sections in U, and P:_robust
Implementation
I made a start in https://github.com/josef-pkt/statsmodels/compare/robust_cov PR #1189
creating a new results instance in a results method
However, it would be better if the cov_params_default were set in the results __init__
problem: I don't have access to the Results Wrapper from inside the results when I create a new results instance, or how do we get access?
-> add to fit method as main access and selection point
I think cov_type='nonrobust' should be treated the same way as the robust covariances, currently we never store normalized_cov_params * scale
RLM and QuantileReg currently specify the type of robust cov in fit.
Econometrics
- subclasses of RegressionResults (GLSAR, GLSHet, IV2SLS, ...) : for which are the results are valid?
- result statistics and diagnostic tests : which ones are still valid?
I needed to change the calculations forfvaluebut there might be more.
Likelihood ratio tests, compare_f - Extensions beyond OLS: Can I just use wresid for WLS, (F)GLS?
yes, to get cov_params and parameter inference, I'm not sure about other statistical results
see issue hat matrix, HC2, HC3 for WLS versus Stata #1209
Activity
josef-pkt commentedon Dec 19, 2013
where is the issue for standardizing keyword arguments,
cov_typeacross models in fitGEE uses
covariance_typejosef-pkt commentedon Aug 23, 2014
added new label
topic_covtypecov_type is now available in regression model, discrete models and GLM
GEE uses now partially the same pattern and naming (not yet fully refactored, lazy calculation)
I need to go through the list of issues to see what's left to do.
josef-pkt commentedon Aug 26, 2014
aside score in Stata is the score_factor to be multiplied with exog in the case of inner linear combination of exog,
I used score_factor and hessian_factor in GLM.
for issues that standardize score_obs and related
jseabold commentedon Sep 26, 2014
Is this just an issue to collect issues? What's the status of all of this?
josef-pkt commentedon Sep 26, 2014
Yes, I started to use
SUMMissues to get an overview over issues related to a topic.I'm more than "halfway" through the robust covariances, but there is still a lot to do. The issues are a collection of references, definitions and refactorings that are required in various places, and "agile" development until I ended up with the current pattern.
I need at least one more full round through all (non-tsa) models to have this finished in a consistent way.
I haven't written anything for the release notes yet.
josef-pkt commentedon Feb 19, 2016
looking over the fence: sandwich options in fit or after in Julia
https://github.com/JuliaStats/GLM.jl/issues/42(avoids cross-linking on github)josef-pkt commentedon Oct 23, 2019
this needs triage to see what still remains here,
maybe make
most of this has been implemented