lib/distribution/logistic/ruby.rb in distribution-0.6.0 vs lib/distribution/logistic/ruby.rb in distribution-0.7.0
- old
+ new
@@ -1,16 +1,16 @@
module Distribution
module Logistic
module Ruby_
class << self
- def rng(u,s)
- lambda {p_value(rand(),u,s)}
- end
+ def rng(u,s)
+ lambda {p_value(rand(),u,s)}
+ end
def pdf(x,u,s )
- (Math.exp(-(x-u)/s))/(s*(1+Math.exp(-(x-u)/s)**2))
+ (Math.exp(-(x-u) / s)) / (s*(1+Math.exp(-(x-u) / s)**2))
end
def cdf(x,u,s )
- 1/(1+Math.exp(-(x-u)/s))
+ 1/(1+Math.exp(-(x-u) / s))
end
def p_value(pr,u,s )
u+s*Math.log(pr/(1-pr))
end
end