[squeak-dev] Re: statistics: standard deviation

glenpaling slp5591 at me.com
Wed Dec 5 14:26:01 UTC 2012


I add these two methods to the math functions protocol of the Collections
class: 

variance

	^(self - self average) squared average

and 

standardDeviation

	^self variance sqrt.

Be careful with large collections integers as these methods will invoke
fraction arithmetic which is rather slow. In most cases it would be better
to force floating point.



--
View this message in context: http://forum.world.st/statistics-standard-deviation-tp4655159p4658151.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.


More information about the Squeak-dev mailing list