fix: correct fuzzy design obs selection and denominator guard#27
Open
Davidvandijcke wants to merge 8 commits intomainfrom
Open
fix: correct fuzzy design obs selection and denominator guard#27Davidvandijcke wants to merge 8 commits intomainfrom
Davidvandijcke wants to merge 8 commits intomainfrom
Conversation
…type - Rename DLL init function to R_init_R3D so R_registerRoutines and R_useDynamicSymbols are called on load (CRAN --as-cran blocker) - Change arg 7 of locweights from double* to int* to match Fortran INTEGER declaration for KERNEL_TYPE (type mismatch blocker) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nt (#5) - Rename DLL init function to R_init_R3D so R's loader correctly invokes it on package load, registering native routines and applying R_useDynamicSymbols(dll, FALSE) — fixes CRAN policy violation. - Add inline comment on the magic number 11 in R_FortranMethodDef listing all Fortran argument names for future editors. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…#7) Add src/*.so, src/*.o, src/*.dll patterns to .Rbuildignore so platform-specific binaries are never included in the R CMD build tarball (CRAN requirement). .gitignore already excluded these files from version control. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Add \donttest{} examples to r3d_bootstrap() and r3d_bwselect()
(fixes CRAN ERROR for missing examples)
- Replace \dontrun{} with \donttest{} in r3d(), plot.r3d(),
print.r3d(), and summary.r3d() examples (fixes CRAN NOTE)
- Add @nord to all @Keywords internal helpers in r3d_utils.R to
suppress NOTE about documented non-exported objects
- Remove orphaned .Rd files for internal functions
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- F1: fix Gini test_crit to use abs(gini_diffs_boot) for consistent two-sided critical value - F2: remove dead f_X_hat / sigma_X / h_bw / kernel computation - F3: remove unused h_num assignment inside doOneDraw - F4: remove no-op scaling_q / scaling_num / scaling_den constants - F5: add clusterSetRNGStream after makeCluster for reproducible Windows parallel bootstrap - F7: add inline comment on e2_w_plus[,1] usage - tests: add Gini test_crit >= 0 / consistent-direction check (F1) and seeded-bootstrap reproducibility test (F5) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…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>
- Replace w_plus[,1]/w_minus[,1] proxy with outTplus\$WINT/outTminus\$WINT for e2_mat row selection in fuzzy designs; outcome-bandwidth proxy silently included/excluded wrong observations in treatment residuals - Raise fuzzy denominator near-zero threshold from 1e-14 to 1e-8, aligning with Stata; values in (1e-14, 1e-8) produced numerically unstable estimates instead of NA Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
w_plus[,1]/w_minus[,1]) with treatment-side Fortran WINT output (outTplus$WINT/outTminus$WINT) fore2_matrow selection in fuzzy designs — wrong observations were silently included/excluded in treatment residuals1e-14to1e-8, aligning with Stata; values in(1e-14, 1e-8)produced numerically unstable estimates instead ofNATest plan
devtools::check()passes: 0 errors, 0 warningstests/testthat/test-r3d-features.RpassNAconsistently with Stata🤖 Generated with Claude Code