Skip to content

fix(stata): improve robustness#14

Open
Davidvandijcke wants to merge 1 commit intomainfrom
fix/stata-robustness
Open

fix(stata): improve robustness#14
Davidvandijcke wants to merge 1 commit intomainfrom
fix/stata-robustness

Conversation

@Davidvandijcke
Copy link
Copy Markdown
Owner

Summary

  • S17: Replace unreliable det(XWX) != 0 singularity check with reciprocal condition number (1/cond(XWX) > epsilon(1)) in r3d_locpoly for robust near-singularity detection
  • S19: Add user-facing notification when plugin fails and falls back to Mata (4 locations in r3d_bandwidth_select and r3d_estimate_core)
  • S20: Fix Gini Lorenz curve endpoint bug in r3d_gini_from_quantile -- prepend 0 instead of qf[1] so the Lorenz curve correctly starts at the origin

Test plan

  • Verify r3d_locpoly handles near-singular XWX matrices without crashing (previously could pass det != 0 check but produce garbage from lusolve)
  • Verify plugin fallback prints a message (test with plugin unavailable or corrupted)
  • Verify Gini coefficient computation matches R implementation for distributions with non-zero minimum quantile values

🤖 Generated with Claude Code

…g, Gini endpoint)

- S17: Replace unreliable det(XWX) != 0 with reciprocal condition number
  check (1/cond(XWX) > epsilon(1)) for robust near-singularity detection
- S19: Add printf notification when plugin fails and falls back to Mata,
  so users know the fallback happened (4 locations)
- S20: Fix Gini Lorenz curve endpoint: prepend 0 instead of qf[1] so the
  Lorenz curve correctly starts at the origin

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