Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the chi square distribution #15799

Merged
merged 1 commit into from
Apr 23, 2021
Merged

Conversation

talgalili
Copy link
Contributor

Adding the chi square distribution, which is central to many statistical procedures (https://en.wikipedia.org/wiki/Chi-square_distribution) (#15798)

Test plan (adding unit-tests)

Following the diff template of: https://github.com/prestodb/presto/pull/11981/files

== RELEASE NOTES ==

General Changes
* Add chisquared_cdf() and inverse_chisquared_cdf() functions.

(like the beta_cds: https://prestodb.io/docs/current/release/release-0.215.html?highlight=beta_cds)

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 10, 2021

CLA Signed

The committers are authorized under a signed CLA.

  • ✅ Tal Galili (32305650ec74d2803365aaeb2344f105aee3717e)

@talgalili
Copy link
Contributor Author

talgalili commented Mar 22, 2021 via email

@talgalili talgalili force-pushed the dist_chisquare branch 5 times, most recently from 8f0545c to cb10950 Compare March 23, 2021 06:27
@talgalili
Copy link
Contributor Author

Hey @v-jizhang ,
tl;dr: I think this diff is ready for review / merging.

Details:
I've fixed the type in the doc, as well as found/fixed a bug in the testing. As far as I can see it all seems to work fine now. There is still some test that didn't finish running (but it doesn't seem related to this diff).
I'll re-base the diff, and have the tests re-run.

Cheers,
T

@talgalili
Copy link
Contributor Author

(rebased)

Copy link
Contributor

@v-jizhang v-jizhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -85,6 +85,18 @@ Mathematical Functions
The a, b parameters must be positive real numbers and value v must be a real value.
The value v must lie on the interval [0, 1].

.. function:: inverse_chi_squared_cdf(df, p) -> double
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the function documentation in alphabetical order. The cdf documentation were in wrong places. You don't need to fix them in this PR, just make sure the new function documentations are added at the correct place.

Copy link
Contributor Author

@talgalili talgalili Mar 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we intend to add more distributions (t, F, Gamma, etc.). I think a better approach is to have a dedicated section in the doc called "Probability distributions" (similar to how the doc currently has "Statistical Functions", "Trigonometric Functions", etc.)

I can do it in a separate diff before-or-after we finish adding all the distribution functions. Makes sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. You can add a separate PR to refactor the documentation first, and rebase this PR on top of that one. Or if you prefer to do that afterwards, let's put these functions in the conventional order for this PR and modify it later.

Copy link
Contributor

@rongrong rongrong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please fix the nits. Thanks for contributing!

@talgalili
Copy link
Contributor Author

talgalili commented Mar 26, 2021 via email

@talgalili
Copy link
Contributor Author

@rongrong - thanks for the diff review.
I've addressed all the issues you've raised (except for the location of the help doc, please see my suggestion above).

Assuming it's all good, please move forward with merging this diff.
Once I see you gave this the green light, me and others from the hackathon will proceed to making all other "distribution function" go through the same workflow.

Thanks!

@talgalili
Copy link
Contributor Author

Hey @rongrong :)
Any update on reviewing this diff? Can it be merged?

@talgalili
Copy link
Contributor Author

talgalili commented Apr 14, 2021 via email

@talgalili talgalili force-pushed the dist_chisquare branch 2 times, most recently from a3f0118 to cf73590 Compare April 14, 2021 19:12
@talgalili
Copy link
Contributor Author

Hey @rongrong - I've now:

  1. re-positioned the function documentation in the (hopefully) correct location
  2. re-based and updated the PR

Please let me know if this now works.

Once Merged, I'll update the other contributors of all the learnings gained in this PR for me, and we'll proceed with preparing more diffs.

Yours,
T

@rongrong rongrong merged commit 6a1d1d7 into prestodb:master Apr 23, 2021
@vaishnavibatni vaishnavibatni mentioned this pull request Apr 27, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants