#17440: variance wants to divide by zero on lists of length 1
------------------------------+------------------------
Reporter: jsrn | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.5
Component: statistics | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
------------------------------+------------------------
Comment (by jsrn):
Well, I'm not a statistician and this behaviour surprised me. It also
seems [http://stackoverflow.com/questions/8023878/standard-deviation-of-
one-element|that not everyone agrees with you], and some argue that 0 is a
fine definition. Furthermore, the case `[]` has completely different
"failure" semantics (returns NaN), and is described in the doc string.
I'm not necessarily saying that the functions shouldn't do something weird
on a 1-list input (though for my use, I wouldn't mind that it just
returned 0). I do suggest that in this case the functions should throw a
ValueError with an appropriate message, and that the behaviour be
mentioned in the doctest.
--
Ticket URL: <http://trac.sagemath.org/ticket/17440#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.