Sha256: d11387bef952d5382e02b575d704f5a9faed1fb1911b9147c625429927d663c0
Contents?: true
Size: 359 Bytes
Versions: 15
Compression:
Stored size: 359 Bytes
Contents
class Array def mean @the_sample_mean ||= inject(:+)/length.to_f end def sample_variance sum = inject(0){|accum, i| accum + (i-mean)**2 } sum/(length - 1).to_f end def stdev Math.sqrt sample_variance end end class Fixnum def mm self * 2.83464566929134 end end class Float def mm self * 2.83464566929134 end end
Version data entries
15 entries across 15 versions & 1 rubygems