Add laplace_cdf and inverse_laplace_cdf functions#17838
Add laplace_cdf and inverse_laplace_cdf functions#17838highker merged 1 commit intoprestodb:masterfrom
Conversation
7d5f6ff to
39d34f4
Compare
|
@jonhehir For the Release Note section, functions need to be represented with |
There was a problem hiding this comment.
There seems to be a constructor which takes in just mean and scale.
You can use this instead. new LaplaceDistribution(mean, scale);
There was a problem hiding this comment.
Thanks! While that does look cleaner, passing the explicit null here is in line with how we handle the other distributions in MathFunctions. According to the docs, the LaplaceDistribution(double, double) constructor implicitly creates a new instance of an RNG, and they recommend explicitly passing a null to the LaplaceDistribution(RandomGenerator, double, double) constructor instead if no sampling is required (which is the case here).
Let me know if we should keep it this way or if you'd like me to change this.
There was a problem hiding this comment.
There seems to be a constructor which takes in just mean and scale.
You can use this instead. new LaplaceDistribution(mean, scale);
Oops! Sorry about that. Edit: Should be fixed now! |
Added CDF and inverse CDF functions corresponding to the Laplace distribution, commonly used in applications of differential privacy. These functions (and their documentation) mimic the form of the other distributions that have been implemented in Presto (e.g., normal, binomial, etc.).
Test plan - Tested by executing manual queries in
presto-clias well as through a small suite of added unit tests. Built docs render appropriately.