File: poisson.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 (32 lines) | stat: -rw-r--r-- 1,151 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
require 'distribution/poisson/ruby'
require 'distribution/poisson/gsl'
require 'distribution/poisson/java'

module Distribution
  # From Wikipedia
  #  In probability theory and statistics, the Poisson distribution is
  #  a discrete probability distribution that expresses the probability of
  #  a number of events occurring in a fixed period of time if these
  #  events occur with a known average rate and independently of the time
  #  since the last event.
  module Poisson
    SHORTHAND = 'pois'
    extend Distributable
    create_distribution_methods

    ##
    # :singleton-method: pdf(k , l)
    # PDF for Poisson distribution,
    # [+k+] is the number of occurrences of an event
    # [+l+] is a positive real number, equal to the expected number of occurrences that occur during the given interval.

    ##
    # :singleton-method: cdf(k , l)
    # CDF for Poisson distribution
    # [+k+] is the number of occurrences of an event
    # [+l+] is a positive real number, equal to the expected number of occurrences that occur during the given interval.

    # TODO: Not implemented yet
    # :singleton-method: p_value(pr , l)
  end
end