File: gamma.rb

package info (click to toggle)
ruby-distribution 0.8.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 624 kB
  • sloc: ruby: 4,535; makefile: 10
file content (35 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download
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
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