-
Notifications
You must be signed in to change notification settings - Fork 198
Pearson correlation among elements of an array #191
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
Conversation
Squashed commit of the following: commit 9cd7538 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 22:48:56 2020 +0200 corr_dev: addition of specs commit 4af1d2d Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 22:29:42 2020 +0200 corr_dev: addition of tests for csp and int32 commit aef4416 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 22:29:08 2020 +0200 corr_dev: addition of tests for csp and int32 commit 0e6ec5d Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 22:19:56 2020 +0200 corr_dev: clarification commit 1fdabd9 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 22:14:44 2020 +0200 corr_dev: correction of an issue with complex commit 1632355 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 21:41:12 2020 +0200 corr_dev:completed impl commit 1fe73b1 Merge: 9da1d97 ce987d2 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 13:13:46 2020 +0200 Merge remote-tracking branch 'upstream/master' into corr_dev commit 9da1d97 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 12:46:05 2020 +0200 corr_dev: addition of tests for int64 commit d03d828 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Sat May 16 12:22:13 2020 +0200 corr_dev: addition of test for dp complex numbers commit 7901ee2 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Fri May 15 20:18:03 2020 +0200 corr_dev: correction for vector with all elements false commit 2a119c2 Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Fri May 15 19:02:12 2020 +0200 corr_dev: done until mask commit 19c1f8e Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Fri May 15 16:42:47 2020 +0200 corr_dev: implemented some correlation functions commit ec16e9c Author: Vandenplas, Jeremie <jeremie.vandenplas@gmail.com> Date: Fri May 15 16:12:13 2020 +0200 corr_dev: init
certik
left a comment
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.
That looks good to me, thanks!
certik
left a comment
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.
Otherwise I think it looks good. Thanks!
certik
left a comment
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 fixing it. I think it looks great now and ready to merge.
milancurcic
left a comment
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.
Thank you!
Co-authored-by: Milan Curcic <caomaco@gmail.com>
Co-authored-by: Milan Curcic <caomaco@gmail.com>
|
If there are no other objections/comments to this PR, I will then merge this evening. |
|
Thank you for your inputs. I'll merge. |
Related to the functions
covandvarAs usual, everything can/must be discussed.
Other implementations
Specs:
corr- Pearson correlation of array elementsDescription
Returns the Pearson correlation of the elements of
arrayalong dimensiondimif the corresponding element inmaskistrue.The Pearson correlation between two rows (or columns), say
xandy, ofarrayis defined as:Syntax
result = corr(array, dim [, mask])Arguments
array: Shall be a rank-1 or a rank-2 array of typeinteger,real, orcomplex.dim: Shall be a scalar of typeintegerwith a value in the range from 1 ton, wherenis the rank ofarray.mask(optional): Shall be of typelogicaland either a scalar or an array of the same shape asarray.Return value
If
arrayis of rank 1 and of typerealorcomplex, the result is of typerealcorresponding to the type ofarray.If
arrayis of rank 2 and of typerealorcomplex, the result is of the same type asarray.If
arrayis of typeinteger, the result is of typereal(dp).If
arrayis of rank 1 and of size larger than 1, a scalar equal to 1 is returned. Otherwise, IEEENaNis returned.If
arrayis of rank 2, a rank-2 array with the corresponding correlations is returned.If
maskis specified, the result is the Pearson correlation of all elements ofarraycorresponding totrueelements ofmask. If every element ofmaskisfalse, the result is IEEENaN.Example