added correlation function to statistics#3015
Conversation
josdejong
left a comment
There was a problem hiding this comment.
Thanks for your PR! I made a few inline comments, can you have a look at those?
1d1d8cb to
d6a403a
Compare
josdejong
left a comment
There was a problem hiding this comment.
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"