Well that's embarrassing. http://trac.sagemath.org/sage_trac/ticket/9028
Doctests all run. ~Andrew On Sun, May 23, 2010 at 11:03 PM, William Stein <[email protected]> wrote: > On Sun, May 23, 2010 at 10:18 PM, TianWei <[email protected]> wrote: >> In the file sage/stats/basic_stats.py, we have the following code for >> the std() function (calculates standard deviation): >> >> 200 if bias: >> 201 # population standard deviation >> 202 if isinstance(x, (int,long)): >> 203 return sqrt(x/ZZ(len(v))) >> 204 return sqrt(x/len(v)) >> 205 else: >> 206 # sample standard deviation >> 207 if isinstance(x, (int,long)): >> 208 return sqrt(x/ZZ(len(v))) >> 209 return sqrt(x/(len(v)-1)) >> >> In line 208, when the "bias" argument is False, the denominator is >> len(v) instead of len(v) - 1. The docstring says it should be dividing >> by len(v) - 1. >> >> Is this a bug? > > Yes, definitely. I've cc'd Andrew Hou, who wrote this code -- maybe > he'll post a quick fix. > Even better -- you could fix the bug and contribute to Sage: > > http://sagemath.org/doc/developer/ > > If anybody creates a ticket about this, be sure to respond to this > email with a link to the ticket (on trac: > http://trac.sagemath.org/sage_trac/). > > -- William > >> >> -- Tianwei >> >> -- >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/sage-support >> URL: http://www.sagemath.org >> > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > -- ..........__o ..........\<, .......( )/ ( ) http://www.thinkandrew.net/ -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
