-
Notifications
You must be signed in to change notification settings - Fork 194
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
Allow omitting standard deviation argument to cov2cor #652
Comments
Yes our function differs from MATLAB's If you want the standard deviations then you can just extract the diagonal of the covariance matrix. Maybe we need a convenience function to do that (see JuliaLang/julia#30250), but I don't think we should make |
Well, my issue was that we don't need the vector of standard deviations |
Ah,good point. @rofinn @ararslan @andreasnoack Any reason why when |
No idea on my end. I have little to no recollection of that PR. Naively, it seems like a reasonable thing to do. |
R and Matlab both have the same signature, without a standard deviation argument:
Find it rather puzzling why one is asked to provide the standard deviation in this case. |
I suspect the reason is historical: this function was originally used internally in Base (now Statistics) to compute the correlation, by a function which had already computed the standard deviations. |
Yeah, I think we were just trying to minimally mimic base. Since I was already using a custom weighted std, it didn't cross my mind to add that default. Seems like a good thing to add though 👍🏻 |
OK, so if anybody wants to make a PR... Should be quite easy. |
I may try to make a PR... Although I am very inexperienced concerning PRs. It is a little embarrassing, but I couldn't find the function |
We discussed is once in one of the chat and also agreed that this would be nice to have. |
|
Made minimal changes to |
You don't actually need to duplicate the full definition of the method AFAICT: just define a default value like this
|
Or |
Yeah but that makes a copy. |
|
The function
cov2cor(C,s)
source code states that: '[It] compute[s] the correlation matrix from the covariance matrixC
and a vector of standard deviationss
. I was expecting a function that would compute the correlation matrix AND the standard deviation, from the covariance matrix only. This approach is followed by Matlab.The text was updated successfully, but these errors were encountered: