[Numpy-discussion] non-standard standard deviation

Dr. Phillip M. Feldman pfeldman at verizon.net
Fri Dec 11 22:13:31 EST 2009




Anne Archibald wrote:
> 
> 2009/11/29 Dr. Phillip M. Feldman <pfeldman at verizon.net>:
> 
>> All of the statistical packages that I am currently using and have used
>> in
>> the past (Matlab, Minitab, R, S-plus) calculate standard deviation using
>> the
>> sqrt(1/(n-1)) normalization, which gives a result that is unbiased when
>> sampling from a normally-distributed population.  NumPy uses the
>> sqrt(1/n)
>> normalization.  I'm currently using the following code to calculate
>> standard
>> deviations, but would much prefer if this could be fixed in NumPy itself:
> 
> This issue was the subject of lengthy discussions on the mailing list,
> the upshot of which is that in current versions of scipy, std and var
> take an optional argument "ddof", into which you can supply 1 to get
> the normalization you want.
> 
> Anne
> 

You are right that I can get the result that I want by setting ddof. 
Thanks!

I still feel that the default value for ddof should be 1 rather than 0; new
users are unlikely to read the documentation for a command like std, because
it is reasonable to expect standard behavior across all statistical
packages.

Phillip
-- 
View this message in context: http://old.nabble.com/non-standard-standard-deviation-tp26566808p26753999.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.




More information about the NumPy-Discussion mailing list