Derive censoring logprob from min max operations#8363
Draft
ricardoV94 wants to merge 2 commits into
Draft
Conversation
ricardoV94
commented
Jul 15, 2026
Member
- Infer logprob of maximum/minimum censoring
- Infer logprob of trunc and round_half_away_from_zero rounding
maximum(x, c) and minimum(x, c) with a single measurable operand are rewritten to one-sided clips (both-measurable graphs are order statistics and are not claimed), reusing the existing clip machinery for the discrete and continuous cases alike. The unbounded side uses the measurable variable itself as its bound, which find_measurable_clips already understood as one-sided clipping and which, unlike +-inf constants, does not upcast discrete variables (previously one-sided clips of discrete variables failed to be claimed for this reason). Whether each side is bounded is decided once at claim time and stored on the MeasurableClip op. Clips of clips are fused eagerly into a single clip by combining the bounds with maximum/minimum (constant bounds fold), so two-sided censoring like maximum(minimum(x, ub), lb) becomes one node. logcdf/icdf are also implemented for clipped variables (the point masses at the bounds absorb the tail quantiles).
Truncation towards zero is the interval [x, x+1) for positive values, (x-1, x] for negative ones, and (-1, 1) pooled at zero. Rounding half away from zero shares the intervals of round half to even, since the tie-breaking rule only differs on a measure-zero set of the continuous base variable.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8363 +/- ##
==========================================
+ Coverage 91.73% 91.75% +0.01%
==========================================
Files 128 128
Lines 20697 20745 +48
==========================================
+ Hits 18987 19034 +47
- Misses 1710 1711 +1
🚀 New features to boost your workflow:
|
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.