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

Inconsistent behavior of exstimators for null samples #100

Open
Shimuuar opened this issue Jul 25, 2016 · 2 comments
Open

Inconsistent behavior of exstimators for null samples #100

Shimuuar opened this issue Jul 25, 2016 · 2 comments

Comments

@Shimuuar
Copy link
Collaborator

Functions for estimation of various statistics have inconsistent behavior for samples of insufficient size. For example for empty sample

  • mean returns NaN
  • welfordMean returns 0
  • Quantile.weightedAvg throws exception.

It's not clear what is correct behavior. One possibility is to simply return Maybe when estimate is impossible but that will require constant unwrapping of Maybes so I'm not sure it's good thing

was brought up in #94

@alexanderkjeldaas
Copy link

I absolutely prefer returning Maybe.

Wrt unwrapping, are you talking about a performance issue? I don't see how this is a practical issue.

@Shimuuar
Copy link
Collaborator Author

I lean towards this solution as well.

By unwrapping I mean that whenever we use mean we have to handle Nothing case. On one hand it's right thing on other it's annoying when you do quick and dirty data exploration. I wonder whether we should provide set of function which call error when encounter insufficient data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants