Sha256: 85b31708274ea215e171011fcdc4c22831152fcfc9d1425a03661640759e4f6e
Contents?: true
Size: 716 Bytes
Versions: 9
Compression:
Stored size: 716 Bytes
Contents
module Distribution # Calculate cdf and inverse cdf for Normal Distribution. # Uses Statistics2 module module Normal class << self # Return the P-value of the corresponding integral def p_value(pr) Statistics2.pnormaldist(pr) end # Normal cumulative distribution function (cdf). # # Returns the integral of normal distribution # over (-Infty, x]. # def cdf(x) Statistics2.normaldist(x) end # Normal probability density function (pdf) # With x=0 and sigma=1 def pdf(x) (1.0/Math::sqrt(2*Math::PI))*Math::exp(-(x**2/2.0)) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems