feat(velox): Add Student's t distribution functions (t_cdf and inverse_t_cdf)#15234
feat(velox): Add Student's t distribution functions (t_cdf and inverse_t_cdf)#15234talgalili wants to merge 1 commit intofacebookincubator:mainfrom
Conversation
✅ Deploy Preview for meta-velox canceled.
|
|
@talgalili has exported this pull request. If you are a Meta employee, you can view the originating Diff in D85123230. |
ab8df58 to
84dce14
Compare
84dce14 to
b56e56a
Compare
b56e56a to
0f67cc8
Compare
0f67cc8 to
0417087
Compare
3d83036 to
445fd27
Compare
445fd27 to
3f7093e
Compare
|
Dear @steveburnett, @hantangwangd and @feilong-liu - this diff is a followup to this one which you've reviewed+accepted+merged: Could you please review this PR as well? Thanks! |
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull branch, local doc build, looks good.
|
@feilong-liu could you please merge this as well (like you did prestodb/presto#26363) ? Thanks upfront! |
3f7093e to
41cb713
Compare
…e_t_cdf) (facebookincubator#15234) Summary: This change adds C++ support for Student's t distribution statistical functions to Velox, complementing the Java/Presto implementation in D85004073. The t-distribution is commonly used in statistical hypothesis testing, particularly when dealing with small sample sizes or when the population standard deviation is unknown. These functions enable users to perform statistical analysis directly within SQL queries. **Functions Added:** - `t_cdf(df, value)`: Computes the cumulative probability P(N < value) for a given degrees of freedom (df) and value - `inverse_t_cdf(df, p)`: Computes the inverse CDF (quantile function) for a given degrees of freedom and probability p **Implementation Details:** - Uses Boost.Math's `students_t_distribution` for accurate calculations - Follows the same patterns as existing probability functions (chi-squared, F-distribution) - Includes proper validation for input parameters (df must be positive, probability must be in [0, 1]) **Files Changed:** 1. `Probability.h`: Added TCDFFunction and InverseTCDFFunction template structs 2. `ProbabilityTrigonometricFunctionsRegistration.cpp`: Registered both functions 3. `ProbabilityTest.cpp`: Added comprehensive unit tests covering edge cases and error handling 4. `math.rst`: Updated documentation with function signatures and parameter descriptions Differential Revision: D85123230
41cb713 to
e9ce7a6
Compare
|
@talgalili has imported this pull request. If you are a Meta employee, you can view this in D85123230. |
HeidiHan0000
left a comment
There was a problem hiding this comment.
Thanks for adding the functions to both Presto Java and Velox!
|
@talgalili merged this pull request in b9bc9fd. |
Summary:
This change adds C++ support for Student's t distribution statistical functions to Velox, complementing the Java/Presto implementation in D85004073.
The t-distribution is commonly used in statistical hypothesis testing, particularly when dealing with small sample sizes or when the population standard deviation is unknown. These functions enable users to perform statistical analysis directly within SQL queries.
Functions Added:
t_cdf(df, value): Computes the cumulative probability P(N < value) for a given degrees of freedom (df) and valueinverse_t_cdf(df, p): Computes the inverse CDF (quantile function) for a given degrees of freedom and probability pImplementation Details:
students_t_distributionfor accurate calculationsFiles Changed:
Probability.h: Added TCDFFunction and InverseTCDFFunction template structsProbabilityTrigonometricFunctionsRegistration.cpp: Registered both functionsProbabilityTest.cpp: Added comprehensive unit tests covering edge cases and error handlingmath.rst: Updated documentation with function signatures and parameter descriptionsDifferential Revision: D85123230