Fix the weak-instrument simulation in Chapter 8 - #485
Open
AliFozooni wants to merge 1 commit into
Open
Conversation
AliFozooni
marked this pull request as ready for review
August 15, 2026 17:54
AliFozooni
force-pushed
the
agent/fix-valid-weak-instrument-simulation
branch
from
August 15, 2026 18:28
822967b to
ffad80e
Compare
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.
Summary
Why this matters
The previous simulation generated each proposed instrument from the confounded treatment. That made the instruments descendants of treatment and correlated with the omitted confounder, so the resulting non-convergence illustrated instrument invalidity rather than weak identification.
The revised experiment uses one valid instrument and 50 separate values of its first-stage coefficient. This isolates relevance while preserving exogeneity and exclusion in every design. It plots conventional standard errors and intervals against the corresponding first-stage F statistic, with the true effect shown explicitly.
The implementation guidance now also makes the correct boundary clear: naively replacing the OLS projection with logistic or black-box fitted values changes the estimator and invalidates ordinary 2SLS inference, but OLS is not the only possible IV method when a procedure supplies appropriate moments, assumptions, and inference theory.
Validation
The full build retains one unrelated pre-existing Chapter 21 lexer warning; Chapter 8 builds without warnings.
Closes #426
Closes #441
Closes #468