-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
added correlation function to statistics #3015
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! I made a few inline comments, can you have a look at those?
1d1d8cb
to
d6a403a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vrushaket , the function looks complete now and well tested.
One last thing: can you please make sure the function names and file names all consistently use "corr" and not "correlation"? I.e. rename correlation.js
to corr.js
, rename createCorrelation
to createCorr
, etc.
…package-lock.json
1e7afe6
to
37359fb
Compare
@josdejong as per asked changes, I have renamed |
Thanks, looks good. I see one unit test is failing, I think it will be fixed by replacing math.corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]])) // returns [0.9569941688503644, 1]) with math.corr(math.matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), math.matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]])) // returns [0.9569941688503644, 1]) Can you try that? |
@josdejong I have made the necessary changes to pass the test case to ensure correct output of the function. Please check. |
Thanks, all tests pass now 🎉 |
Published now in |
This PR adds correlation function to statistics and solves the issue "Correlation function #2624"