Module: Distribution::Normal::GSL_

Defined in:
lib/distribution/normal/gsl.rb

Class Method Summary collapse

Class Method Details

.cdf(x) ⇒ Object

:nodoc:



10
11
12
# File 'lib/distribution/normal/gsl.rb', line 10

def cdf(x) # :nodoc:
  GSL::Cdf::ugaussian_P(x)
end

.gslObject



19
20
# File 'lib/distribution/normal/gsl.rb', line 19

def gsl
end

.p_value(qn) ⇒ Object



16
17
18
# File 'lib/distribution/normal/gsl.rb', line 16

def p_value(qn)
  GSL::Cdf::ugaussian_Pinv(qn)
end

.pdf(x) ⇒ Object

:nodoc:



13
14
15
# File 'lib/distribution/normal/gsl.rb', line 13

def pdf(x) # :nodoc:
  GSL::Ran::gaussian_pdf(x)
end

.rng(mean = 0, sigma = 1, seed = nil) ⇒ Object



5
6
7
8
9
# File 'lib/distribution/normal/gsl.rb', line 5

def rng(mean=0,sigma=1,seed=nil)
  seed||=rand(10e8)
  rng=GSL::Rng.alloc(GSL::Rng::MT19937,seed)
  lambda { mean+rng.gaussian(sigma)}
end