Ticket #9028: trac_9028_stats.patch

File trac_9028_stats.patch, 648 bytes (added by amhou, 11 years ago)
  • sage/stats/basic_stats.py

    # HG changeset patch
    # User Andrew Hou <hou.andrew@gmail.com>
    # Date 1274683676 25200
    # Node ID 80122f1d16e0e5a739864783081e7842d75df55f
    # Parent  933b6866b44149fd8b89110b03b4bbc6bb657ed5
    Fixed bug in calculating standard deviation
    
    diff -r 933b6866b441 -r 80122f1d16e0 sage/stats/basic_stats.py
    a b  
    207207    else:
    208208        # sample standard deviation
    209209        if isinstance(x, (int,long)):
    210             return sqrt(x/ZZ(len(v)))
     210            return sqrt(x/ZZ(len(v)-1))
    211211        return sqrt(x/(len(v)-1))
    212212
    213213