update approach to isotonic calibration#47
Merged
Merged
Conversation
malcolmbarrett
commented
Feb 18, 2026
Member
- update isoreg calibration
- remove news file until submission
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the isotonic regression calibration approach in ps_calibrate() to use a custom weighted pool-adjacent-violators algorithm (PAVA) instead of stats::isoreg(). The new implementation follows the two-step isotonic regression method described in van der Laan et al. (2024) and matches the behavior of WeightIt::calibrate(method = "isoreg").
Changes:
- Implements custom
pava_weighted()function for isotonic regression without grouping tied x-values - Updates
ps_calibrate()to use two-step calibration: separate isotonic regressions for treated and control groups - Adds comprehensive unit tests for
pava_weighted()covering edge cases and expected behavior - Removes
stats::isoregimport from NAMESPACE (no longer needed) - Removes NEWS.md file temporarily until ready for submission
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| R/ps_calibration.R | Adds new pava_weighted() internal function and updates ps_calibrate() to use two-step isotonic regression approach |
| tests/testthat/test-ps_calibration.R | Adds 8 comprehensive unit tests for pava_weighted() function covering various edge cases |
| NAMESPACE | Removes stats::isoreg import that is no longer used |
| NEWS.md | Removes file temporarily (per PR description, will be added back for submission) |
| .Rbuildignore | Adds .beads to build ignore list (likely a development tool configuration) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.