Repository navigation
BUG: Use 3SLS by default when the equations share regressors but not … - #793
Merged
Merged
Conversation
…instruments IV3SLS.fit chooses method="ols" (equation by equation estimation) by default if the regressors are the same objects in every equation, since GLS and OLS are then the same estimator. The test compared the exog and endog of the equations but not their instruments. When the equations have the same exog and endog but different instruments, the first stage projections differ across equations and three-stage least squares is not 2SLS by equation. IV3SLS reported "Common Exogenous Variables" and returned the 2SLS estimates, which differ from the 3SLS estimates by up to 0.36 in an example with two equations that share one endogenous regressor and use two different instruments each. The instruments are now part of the comparison, so the default is GLS (3SLS) unless the instruments are common as well. Models whose equations share exog, endog and instruments, and SUR, are unchanged. The test compares the default estimates with a direct computation of 3SLS and checks that common instruments still give the equation by equation estimator. It fails without the change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #793 +/- ##
==========================================
+ Coverage 99.59% 99.60% +0.01%
==========================================
Files 128 137 +9
Lines 24435 26315 +1880
Branches 1820 1888 +68
==========================================
+ Hits 24336 26212 +1876
+ Misses 39 38 -1
- Partials 60 65 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…instruments
IV3SLS.fit chooses method="ols" (equation by equation estimation) by default if the regressors are the same objects in every equation, since GLS and OLS are then the same estimator. The test compared the exog and endog of the equations but not their instruments. When the equations have the same exog and endog but different instruments, the first stage projections differ across equations and three-stage least squares is not 2SLS by equation. IV3SLS reported "Common Exogenous Variables" and returned the 2SLS estimates, which differ from the 3SLS estimates by up to 0.36 in an example with two equations that share one endogenous regressor and use two different instruments each.
The instruments are now part of the comparison, so the default is GLS (3SLS) unless the instruments are common as well. Models whose equations share exog, endog and instruments, and SUR, are unchanged.
The test compares the default estimates with a direct computation of 3SLS and checks that common instruments still give the equation by equation estimator. It fails without the change.