Module: Distribution::Normal::Java_
- Defined in:
- lib/distribution/normal/java.rb
Overview
TODO
Class Method Summary collapse
-
.cdf(x) ⇒ Object
Return the cumulative density function at x.
-
.p_value(qn) ⇒ Object
Get the inverse cumulative density function (p-value) for qn.
-
.pdf(x) ⇒ Object
Return the probability density function at x.
-
.rng(mean = 0, sigma = 1, seed = nil) ⇒ Object
Generate random variables from the provided distribution.
Class Method Details
.cdf(x) ⇒ Object
Return the cumulative density function at x
22 23 24 25 |
# File 'lib/distribution/normal/java.rb', line 22 def cdf(x) dist = NormalDistributionImpl.new dist.cumulativeProbability(x) end |
.p_value(qn) ⇒ Object
Get the inverse cumulative density function (p-value) for qn
15 16 17 18 |
# File 'lib/distribution/normal/java.rb', line 15 def p_value(qn) dist = NormalDistributionImpl.new dist.inverseCumulativeProbability(qn) end |
.pdf(x) ⇒ Object
Return the probability density function at x
29 30 31 32 |
# File 'lib/distribution/normal/java.rb', line 29 def pdf(x) dist = NormalDistributionImpl.new dist.density(x) end |
.rng(mean = 0, sigma = 1, seed = nil) ⇒ Object
Generate random variables from the provided distribution
8 9 10 11 |
# File 'lib/distribution/normal/java.rb', line 8 def rng(mean=0,sigma=1,seed=nil) dist = NormalDistributionImpl.new(mean, sigma) lambda { dist.sample } end |