Skip to content

Add HC1/HC2/HC3 estimators, improve tests and docs - #27

Merged
eloualiche merged 1 commit into
FixedEffects:mainfrom
matthieugomez:hc-estimators-and-cleanup
Mar 30, 2026
Merged

Add HC1/HC2/HC3 estimators, improve tests and docs#27
eloualiche merged 1 commit into
FixedEffects:mainfrom
matthieugomez:hc-estimators-and-cleanup

Conversation

@matthieugomez

Copy link
Copy Markdown
Member

Summary

  • Add Vcov.hc(n) constructor for HC1, HC2, HC3 heteroskedasticity-robust variants; robust() remains HC1 for backward compatibility
  • HC2/HC3 use leverage-adjusted residuals (OLS only)
  • Switch from manual Base.precompile hints to PrecompileTools @compile_workload
  • Add vcov computation tests verified against manual formulas (Simple, Robust HC1, HC2, HC3, Cluster, ranktest)
  • Fix README: replace nonexistent dof_tstat with dof_residual, document all estimators
  • Minor cleanup: || in ranktest, remove unused import, simplify S_hat broadcasting
  • Bump version to 0.8.3

Test plan

  • All 36 tests pass locally (Pkg.test())
  • CI passes on GitHub Actions

🤖 Generated with Claude Code

- Add `Vcov.hc(n)` constructor for HC1, HC2, HC3 variants; `robust()` remains HC1
- HC2/HC3 use leverage-adjusted residuals (OLS only)
- Switch from manual Base.precompile hints to PrecompileTools @compile_workload
- Add vcov computation tests verified against manual formulas (Simple, Robust, HC2, HC3, Cluster)
- Add ranktest smoke tests and edge case tests
- Fix README: replace nonexistent dof_tstat with dof_residual, document all estimators
- Minor cleanup: || in ranktest, remove unused import, simplify S_hat broadcasting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Mar 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.26%. Comparing base (ed81967) to head (a1abbd5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/covarianceestimators/vcovrobust.jl 97.05% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #27       +/-   ##
===========================================
+ Coverage   28.57%   92.26%   +63.69%     
===========================================
  Files           7        7               
  Lines         140      168       +28     
===========================================
+ Hits           40      155      +115     
+ Misses        100       13       -87     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eloualiche
eloualiche merged commit 0245d68 into FixedEffects:main Mar 30, 2026
2 checks passed
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.

3 participants