commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Math] StatUtils.variance
Date Thu, 29 Aug 2013 20:45:10 GMT
It seems that the method StatUtils.variance()uses (n-1) as the divisor, 
not n. I got the following results,

StatUtils.variance(new double[]{-1,0,1}) = 1.0
StatUtils.variance(new double[]{-2,-1,0,1,2}) = 2.5

It should use n as divisor and the result should be 2/3 and 2.0, right? 
This is Apache Commons 3.2.


The contents of this email are the property of PNC. If it was not addressed to you, you have
no legal right to read it. If you think you received it in error, please notify the sender.
Do not forward or copy without permission of the sender. This message may contain an advertisement
of a product or service and thus may constitute a commercial electronic mail message under
US Law. The postal address for PNC is 249 Fifth Avenue, Pittsburgh, PA 15222. If you do not
wish to receive any additional advertising or promotional messages from PNC at this e-mail
address, click here to unsubscribe. 
By unsubscribing to this message, you will be unsubscribed from all advertising or promotional
messages from PNC. Removing your e-mail address from this mailing list will not affect your
subscription to alerts, e-newsletters or account servicing e-mails.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message