Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #860 +/- ##
==========================================
- Coverage 99.68% 99.68% -0.01%
==========================================
Files 199 203 +4
Lines 37875 38500 +625
Branches 2436 2455 +19
==========================================
+ Hits 37756 38378 +622
- Misses 51 54 +3
Partials 68 68
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:
|
|
While I'm not fundamentally opposed to this PR or the direction, it is too heavy. It has many large binary files. Retaining results is fine, but I would suggest putting them in a single file. If the data is needed, it should be simulated internally as part of the process. If you need the data to confirm R results, simply simulate it in Python, then check R and record results as needed, and then use the same simulation in the test suite. |
|
Thanks, Kevin. I agree that the PR was carrying too much data. I’ve pushed b4a3497 to remove the duplicated calibration files and simplify the implementation. The binaries contained precomputed tF critical-value tables used during inference. The test inputs are already generated in Python with a fixed seed. The revised implementation calls the public API of Both tF methods now require the optional All 109 feature tests pass against the PyPI installation. I also compared 18,108 inputs across all 18 confidence levels with the previous reader, including boundary and plateau cases, and obtained identical results. The full suite has 23,387 passing tests; its 13 failures reproduce on the previous PR head (one existing RandomEffects case and 12 notebook socket restrictions in the local sandbox). Style checks pass, both distributions build without the calibration files, and remote CI is running. |
Adds
IVResults.tf_conf_int(level=0.95, *, method="table")for IV2SLS with one endogenous regressor and one excluded instrument. The method reuses the fitted coefficient, covariance convention and first-stage regression. Included controls, constant weights, unadjusted or robust covariance (including aliases), anddebiased=Falseare supported. Unsupported configurations raiseValueError; conventional inference is unchanged.Both methods delegate to the public API of the optional tf-inference package. That package owns table loading, interpolation, integrity checks and calibration caching. This PR contains no calibration binaries or copied metadata. The adapter maps confidence levels to the package's exact significance-level keys and caches that mapping.
Using tF inference requires installing tf-inference 0.1.0 from PyPI with Python 3.12+, NumPy 1.26+, SciPy 1.12+ and PyArrow 18+. Installation instructions and compatible CI jobs pin the published release. Core linearmodels requirements are unchanged, and a missing optional package produces installation guidance when tF inference is requested.
The default table method covers 18 confidence levels from 75% to 99.99%, with no interpolation across levels or implicit numerical calibration. Explicit
method="compute"supports other levels within that range. At 95%, F strictly above approximately 3.84145882 gives finite bounds, including F between that boundary and 4. For an estimate of 1, SE of 0.4 and F=10, the interval is approximately [-0.37214, 2.37214]. Each confidence level has its own calibrated plateau.Calibration uses deterministic integration, a finite nuisance-parameter grid and local searches. Numerical validation is not a uniform size proof, a conservative rounding guarantee, or a finite-sample coverage guarantee. The procedure remains asymptotic under the single-instrument IV assumptions; no p-value API is introduced.
The dependency uses the independently reviewed 0.1.0 release, which stores its calibrations in one validated Parquet file. All 109 tF feature tests pass against the PyPI installation; changed-file style checks and all 15 guide examples pass. The published package separately passes all 137 tests in a clean environment, and its installed source/data files match the reviewed candidate.
Earlier full-suite and artifact validation at
b4a3497cd1b3e623dab9f6193c50ae688b6e12ac:References: Valid t-Ratio Inference for IV; author manuscript, Appendix B.3; calibration package release and validation.
AI assistance was used for implementation, testing and documentation.