File: gamma.rb

package info (click to toggle)
ruby-distribution 0.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 572 kB
  • ctags: 370
  • sloc: ruby: 4,270; makefile: 5
file content (37 lines) | stat: -rw-r--r-- 1,005 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/gamma/ruby'
require 'distribution/gamma/gsl'
# no statistics2 functions for gamma.
require 'distribution/gamma/java'

module Distribution
  # From Wikipedia:
  #    The gamma distribution is a two-parameter family of 
  #    continuous probability distributions. It has a scale parameter a
  #    and a shape parameter b.
  # 
  # Calculate pdf, cdf and inverse cdf for Gamma Distribution.
  #
  module Gamma
    extend Distributable
    SHORTHAND='gamma'
    create_distribution_methods

    ##
    # :singleton-method: pdf(x,a,b)
    # Returns PDF of of Gamma distribution with +a+ as scale
    # parameter and +b+ as shape parameter


    ##
    # :singleton-method: cdf(x,a,b)
    # Returns the integral of Gamma distribution with +a+ as scale
    # parameter and +b+ as shape parameter

    ##
    # :singleton-method: p_value(qn,a,b)
    # Return the upper limit for the integral of a 
    # gamma distribution which returns +qn+ 
    # with scale +a+ and shape +b+

  end
end