Skip to content

fix: review findings for stata_r3d/mata/r3d_mata.mata#22

Open
Davidvandijcke wants to merge 3 commits intomainfrom
fix/review-stata_r3d-mata-r3d_mata
Open

fix: review findings for stata_r3d/mata/r3d_mata.mata#22
Davidvandijcke wants to merge 3 commits intomainfrom
fix/review-stata_r3d-mata-r3d_mata

Conversation

@Davidvandijcke
Copy link
Copy Markdown
Owner

Automated fixes from code review pipeline.

Davidvandijcke and others added 3 commits March 5, 2026 00:57
…scope, saving CI)

S1:  Fix double-dereference ``fuzzy'' / ``weights'' -> `fuzzy' / `weights'
S7:  Read r(pilot_den) and r(h_den) into locals immediately after Mata call
     before intervening commands can clear r() results
S8:  Track Mata loading success via local mata_loaded instead of ambient _rc
S18: Remove redundant tempvar drops in r3d_bwselect.ado
S21: saving() now writes bootstrap CB bounds instead of pointwise normal CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
F1: replace det()!=0 with abs(det())>1e-10 in r3d_locpoly and
    r3d_fit_global_poly to catch near-singular matrices

F2: fix fuzzy bootstrap to use treatment-side kernel weights
    (w_t_plus/w_t_minus) for e2 delta-method linearization instead
    of outcome-side weights; add w_t_plus_name/w_t_minus_name params
    to r3d_bootstrap and update r3d_bootstrap.ado caller

F3: replace r3d_test_gini stub body with explicit error() call;
    previously silently returned p-value=0.5 regardless of data

F4: add assert(cols(T)==1) after T view load and assert(pilot_h_den>0)
    after fallback assignment in r3d_bandwidth_select

F5: rewrite _r3d_load_csv with two-pass pre-allocation to avoid
    O(n^2) matrix growth via repeated row-append

F6: add linear interpolation to weighted quantile path mirroring
    the unweighted type-7 logic for consistency

F7: emit errprintf warning when multiple test ranges are supplied
    and only the first is used

F8: add optional seed_val parameter to r3d_bootstrap for
    reproducible bootstrap draws via rseed(); update .ado to pass seed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant