You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by "jaideeppyne (via GitHub)" <gi...@apache.org> on 2026/09/30 02:31:54 UTC

[PR] fix(tdigest): correct rank and quantile tails [datasketches-cpp]

jaideeppyne opened a new pull request, #531:
URL: https://github.com/apache/datasketches-cpp/pull/531

   The C++ t-digest still disagrees with the Java, Go, and Rust sketches on three quantile and rank cases those ports already fixed.
   
   - `get_rank()` did not divide the left tail by the total centroid weight, so a value below the first centroid could report a rank greater than 1. The right tail was already normalized.
   - `get_quantile()` added the right-tail offset onto the maximum, so estimates could land above the stored max. The tail is measured back from the maximum. A last centroid of weight 2 makes that division 0/0, and the only rank that reaches it is the maximum itself, so return the maximum.
   - Interpolation weighted each centroid by the distance to itself. Weighting by the distance to the other centroid pulls the estimate toward the nearer one.
   
   The new tests follow the Java cases: quantiles over 10k updates stay monotonic and inside `[min, max]`, a byte-patched heavy first centroid keeps ranks inside `[0, 1]`, a heavy last centroid never exceeds max, weight 2 returns max rather than NaN, and an asymmetric interior point returns 13 rather than 17.
   
   Tests: `tdigest_test` (55 cases).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] fix(tdigest): correct rank and quantile tails [datasketches-cpp]

Posted by "leerho (via GitHub)" <gi...@apache.org>.
leerho merged PR #531:
URL: https://github.com/apache/datasketches-cpp/pull/531


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org