ltriangle robustness: finite starting values, bounded-support tests, docs - #183
Merged
joethorley merged 2 commits intoJul 14, 2026
Merged
Conversation
…nded-support tests and docs Follow-up to #169. - sltriangle() falls back to a small positive half-width when the data have no spread on the log scale, avoiding a -Inf starting value. - Add tests that ssd_hc()/predict() are finite and monotonic across the full 1-99% range for the bounded-support distribution. - Note in the distributions vignette that ltriangle is experimental and not part of the default BCANZ set. Co-Authored-By: Claude Fable 5 <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.
Follow-up to #169 (targets the
add-triangle-distributionbranch).Addresses the non-behavior-changing review items from the #169 review:
sltriangle()starting values. When the data have no spread on the log scale (e.g. all concentrations equal),max(abs(logx - location))is 0 andlog_scalelogbecame-Inf. It now falls back to a small positive half-width so the starting value stays finite. Fits on data with spread are unchanged.ssd_hc()andpredict()return finite, monotonic estimates across the full 1-99% range.ltriangleis experimental and not part of the default BCANZ set (ssd_dists_bcanz()), so it is only fitted when explicitly requested.No change to fitted results for normal data, so no fit-value snapshots change.
The relative-density-floor change (the statistical item from the review) is handled separately in a companion PR so the likelihood change and its snapshot updates can be reviewed on their own.
🤖 Generated with Claude Code