File: poisson.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 (34 lines) | stat: -rw-r--r-- 1,170 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
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