File: normal.rb

package info (click to toggle)
ruby-distribution 0.7.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 624 kB
  • ctags: 379
  • sloc: ruby: 4,283; makefile: 7
file content (37 lines) | stat: -rw-r--r-- 994 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'distribution/normal/ruby'
require 'distribution/normal/gsl'
require 'distribution/normal/statistics2'
require 'distribution/normal/java'

module Distribution
  # From Wikipedia: 
  #   Continuous probability distribution that is often used as 
  #   a first approximation to describe real-valued random variables 
  #   that tend to cluster around a single mean value. 
  #   The graph of the associated probability density function is  “bell”-shaped
  module Normal
    SHORTHAND='norm'
    extend Distributable
    
    create_distribution_methods
    
    ##
    # :singleton-method: pdf(x)
    # Returns PDF of Normal distribution 

    ##
    # :singleton-method: p_value(qn)
    # Return the P-value of the corresponding integral +qn+
    
    ##
    # :singleton-method: cdf(x)
    # Returns the integral of Normal distribution over [0, +x+]
    
    ##
    # :singleton-method: rng
    # Returns a lambda which returns a random number from
    # X ~ N(0,1)

    
  end
end