Repository navigation
REF/ENH Penalized linear TheilGLS, ridge - #1665
Conversation
|
forgot about py3 compatibility, |
|
nice paper http://www.jstor.org/stable/1241927 R beta + v = q ' extra Mittelhammer, Conway mention a test for risk superiority of the TG estimator. |
|
bump, check and merge with warnings if there are still results missing. |
a3b242b to
b44223d
Compare
|
rebased (no merge conflicts) note: this is still in the sandbox in a generically named AFAIR: |
|
travis: precision failure in some python, rtol=1e-11 in |
BUG: incomplete refactoring
use rank in share_data
|
After trying out the examples (copied from
|
|
Bug and, the only difference in cov_params between the two cov_types comes from the scale df |
|
naming: don't use |
|
I'm a bit stuck (as a programming exercise) What is df_resid supposed to be? Should it really depend on cov_type? I'm trying to fix model.normalized_cov_params to be independent of cov_type If I use xpxi, Even when I fix the corrfact for textile bse test case, then pvalues and conf_int still fail. |
|
another possible problem: |
|
commit "try refactor normalized_cov_params, cheat in test against tgmixed" |
1 similar comment
|
another use case and possible test case based on equivalence using theil-goldberger for data combination splitting sample and using the first part as prior for the second part. edit Most likely this comes from the use of the GLS scale sigma2_e in the weight between data and prior. We don't update this because it is irrelevant when we choose the weight with minic for example. |
|
however, bse doesn't fully match up, and sandwich matches better than "data-prior" One possibility, we are pooling information for the params, but we are not pooling information for the scale. Even though we don't match very closely, the results are still close, e.g. the bse for the two subset OLS are, so we are still pooling cov_params with Theil almost the same as the pooled OLS. |
|
cov_type="data-prior" is off by a constant factor, so it's a small scale pooling or correction issue, I guess. in another run, with a different generated random sample, the factor is 0.91310453, so it's data dependent. a bit tricky (not completely clear without going through the math): in the weighted mean for params we use sigma2_e * lambd to compute xpx. however lambd is set to w the subsample scale ration. |
|
relationship to fit_regularized elastic net |
|
I lowered the sample size for the unit tests compared to my experimentation script from 600 to 300. |
1 similar comment
|
as reference here is my notebook https://gist.github.com/josef-pkt/728ffbca867f0b4925b88383dda3cc7b |
|
Given that the model is still in the sandbox, I think we can merge essentially as it is now. The contrast/restriction helper functions need to be consolidated somewhere as we merge also the other penalized PRs. Also we get more generic code with similar purpose to test against, i.e. there is some overlap in parts of it with the GAM L2 penalization. one inconsistency: |
|
Note: cov_type='sandwich' is not HC, it is the M-estimator sandwich assuming iid observations/residuals (or at least variance uncorrelated or independent of exog). (that's similar to RLM, IIRC) I didn't check any of the standard cov_types. |
|
I added some renamings, a bit of cleanup and regression tests for select_pen_weight. merge when green, so I can go back to other things. |
|
all green, merging |
some enhancements cleanup and unit test for TheilGLS
Still WIP but ready for TravisCI
TODOs
more unit tests
fit_minic, no reference implementation ? scikit-learn ?(R MASS lm.ridge uses a different parameterization, Longley looks weird also in R)
other
most likely not in this PR:
unclear
perfect multicollinearity affects the inference for the base parameters, cov_params, bse, and similar.
Can I separate the effect? eg. precise fixed effects and imprecise random effects.
Note: even a small prior resolves perfect multicollinearity in the expected way for the
paramsbias: cov_params is pretty standard, but should we do something about the bias. Confidence interval will be centered around a biased estimate if prior information is biased as in Ridge.
extra references
reference for HC robust cov not yet available as pdf (in print)
http://www.tandfonline.com/doi/abs/10.1080/03610918.2012.750354#.U3LRKleFUy4
Muhammad Aslam "Using Heteroscedasticity Consistent Standard Errors for the Linear Regression Model with Correlated Regressors" Communications in Statistics - Simulation and Computation
(I didn't read it yet, but derivation of robust sandwiches is pretty generic, only Theil cov_type='data-prior' has and extra additive term that doesn't fit the current pattern.)
edit no available as pdf, in Monte Carlo comparison (looking at graphs) HC3 has best coverage, using effective degrees of freedom.