Module: Distribution::LogNormal::Ruby_

Defined in:
lib/distribution/lognormal/ruby.rb

Class Method Summary collapse

Class Method Details

.cdf(x, u, s) ⇒ Object

def p_value(pr,u,s) end



14
15
16
# File 'lib/distribution/lognormal/ruby.rb', line 14

def cdf(x,u,s)
  Distribution::Normal.cdf((Math.log(x)-u) / s)
end

.pdf(x, u, s) ⇒ Object



6
7
8
9
# File 'lib/distribution/lognormal/ruby.rb', line 6

def pdf(x,u,s)
  raise "x should be > 0 " if x < 0
  (1.0/(x*s*Math.sqrt(2*Math::PI)))*Math.exp(-((Math.log(x)-u)**2 / (2*s**2)))
end