Skip to content

Poisson Distribution

Esteban Zapata Rojas edited this page Oct 19, 2017 · 1 revision

Poisson Distribution

Instance methods

Probability mass function

It returns the probability mass value for the specified K. If K < 0 or the expected number of occurrences specified at initialization time is smaller than zero, then the function is not defined.

[67] pry(main)> Distribution::Poisson.new(-5)
=> #<Statistics::Distribution::Poisson:0x0000000001ba0aa8 @expected_number_of_occurrences=-5>
[68] pry(main)> Distribution::Poisson.new(-5).probability_mass_function(3)
=> nil
[69] pry(main)> Distribution::Poisson.new(3).probability_mass_function(3)
=> 0.22404180765538775
[70] pry(main)> Distribution::Poisson.new(3).probability_mass_function(-2)
=> nil

Cumulative function

It returns the probability P(x <= K) for an specified K. If K < 0 or the expected number of occurrences specified at initialization time is smaller than zero, then the function is not defined.

[71] pry(main)> Distribution::Poisson.new(3).cumulative_function(-2)
=> nil
[72] pry(main)> Distribution::Poisson.new(-2).cumulative_function(3)
=> nil
[73] pry(main)> Distribution::Poisson.new(5).cumulative_function(4)
=> 0.4404874360944001

Mean

Variance

The mean and the variances are the same as the expected number of occurrences specified at initialization time.