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

spearman returns NaN. #128

Open
GregorySchwartz opened this issue Aug 3, 2017 · 6 comments
Open

spearman returns NaN. #128

GregorySchwartz opened this issue Aug 3, 2017 · 6 comments

Comments

@GregorySchwartz
Copy link

spearman should return Nothing rather than NaN:

spearman $ V.fromList [(1, 3), (5, 3)], or any case where one of the two variables is a constant.

@Shimuuar
Copy link
Collaborator

Shimuuar commented Aug 4, 2017

Good catch! Would you mind to provide fix for it?

@GregorySchwartz
Copy link
Author

GregorySchwartz commented Aug 4, 2017

This would change correlation, pearson, and pearsonMatByRow to return Maybe as well. pearsonMatByRow may have issues as well if the Matrix type should have Nothing as elements rather than throwing out the entire matrix, because there is no instance for Unbox (Maybe a).

@Shimuuar
Copy link
Collaborator

Shimuuar commented Aug 4, 2017

Ohhh... It's going to be a big change. Feel free to share your opinion on the matter

@Shimuuar
Copy link
Collaborator

I starting to think that we should do such conversion and return Nothing when no result could be computed. We could do it incrementally and start by convertin correlation & pearson. And decide what to do with pearsonMatByRow later

@GregorySchwartz
Copy link
Author

That sounds fine, but maybe return Nothing for pearsonMatByRow? The only issue is when finding bugs, it would be a tad more annoying to see which comparison is returning Nothing.

@ocramz
Copy link
Contributor

ocramz commented Jul 19, 2018

I've started addressing this here: https://github.com/DataHaskell/statistics/tree/exceptions-not-error

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

No branches or pull requests

3 participants