Skip to content

Compare lr test rebased - #1214

Merged
josef-pkt merged 14 commits into
statsmodels:masterfrom
josef-pkt:compare_lr_test_rebased
Dec 11, 2013
Merged

josef-pkt merged 14 commits into
statsmodels:masterfrom
josef-pkt:compare_lr_test_rebased

Conversation

@josef-pkt

Copy link
Copy Markdown
Member

rebased and cleaned up version of @bashtage PR #1174

I skipped some redundant commits, and edited the commits during merge conflicts (in almost every commit).

Main change besides cleanup of reverted and unnecessary commits is in default cov_type="nonrobust" especially commit 4d517f5

A second change that I kept from my sandwich branch and didn't change during rebase is that the default is use_t=None not use_t=False. A minor generic reason is that in this case we can identify if the user explicitly specifies use_t. The main reason is that None means default, which will be use_t=True with cov_type='nonrobust' in linear model, but I think also withcov_type='cluster', andFalse` for all other covariances and models.
Still up for debate.

I'd like to merge this before #1173 and #1176 because I saw one duplicate commit too late to drop it.

Discussion on cov_type="nonrobust"

#1189 (comment) and follow-up

I changed "H" for homoscedasticity to "nonrobust", both because I'm not a fan of one letter names (does H mean homo- or heteroscedasticity as in HCx), and because "nonrobust" doesn't imply that we assume homoscedasticity.

To the later point:

  • We can estimate a linear model with WLS that uses an estimated heteroscedasticity function (the wresid would be homoscedastic but not the resid if the specification is correct). However, we can still use either a robust or a nonrobust covariance matrix after estimating with WLS.
  • In Poisson and most other generalized linear models we have an implied heteroscedasticity. "nonrobust" means that the heteroscedasticity of the underlying (Q)MLE model is not assumed to be correctly specified.

Same applies to auto- or cluster correlation.

Plus, Wooldridge talks all the time of using robust or not robust covariance matrices or hypothesis tests.

So far I can think of only "nonrobust" that captures the idea that we are not robust to misspecification of the error covariance matrix. The opposite view would be the model has correctly specified second moments, but I don't know a good short name for that.

bashtage and others added 13 commits November 29, 2013 18:45
…ts when the weight matrix or sigma are diagonal with the same values
Fixed loglikelihood in WLS
Lots of Typo fixed in docstrings
PEP8 fixes
Added _is_nested method to detect nested models
rebase conflicts fixed, hopefully
Fixed test for summary which was failing due to now mandatory cov_type
Added additional OLS/WLS/GLS equivalence tests
Added _is_nested to test whether models are nested when comparing models
Added compare_lm_test
Merged with get_robustvcv_result which is needed to implement tests
Added large sample likelihood-ratio test
Implemented cov_type for all models including homoskedastic regression.  Use 'H' for the homoskedastic case
heavily edited for 'nonrobust' instead of 'H' during rebase
@josef-pkt

Copy link
Copy Markdown
Member Author

I didn't review yet the new functions in detail.

@bashtage do you see anything obvious that I might have messed up during rebase?

The test suite passes, and I would like to merge this soon, so we have again a common code for working on the next parts, with hopefully fewer merge conflicts next time.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling aad6bae on josef-pkt:compare_lr_test_rebased into a14d989 on statsmodels:master.

Comment thread statsmodels/regression/linear_model.py Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase error
this is duplicate from above line 1495 and should be deleted
call to compare_lm_test uses robust cov

@josef-pkt josef-pkt mentioned this pull request Dec 11, 2013
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 80acfff on josef-pkt:compare_lr_test_rebased into a14d989 on statsmodels:master.

@josef-pkt

Copy link
Copy Markdown
Member Author

merging this

Thank you Kevin,
I'm going to merge the other two PR next.
I don't remember now where the WLS=GLS change is because I don't see any test failures.

josef-pkt added a commit that referenced this pull request Dec 11, 2013
@josef-pkt
josef-pkt merged commit fe97936 into statsmodels:master Dec 11, 2013
@josef-pkt
josef-pkt deleted the compare_lr_test_rebased branch December 16, 2013 14:21
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants