class Statistics::Distributions::Poisson

Overview

Represents a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time or space if these events occur with a known constant mean rate and independently of the time since the last event (source: wikipedia)

Defined in:

lib/distributions.cr

Constructors

Instance Method Summary

Instance methods inherited from class Statistics::Distributions::DiscreteDistribution(Int32)

pmf(x) pmf

Instance methods inherited from class Statistics::Distributions::Distribution(Int32)

rand : T rand

Constructor Detail

def self.new(lambda : Float64) #

Creates a Poisson distribution with expected value lambda.


Instance Method Detail

def pmf(x) #

The Probability Mass Function (PMF) of a discrete random variable.


def rand : Int32 #
Description copied from class Statistics::Distributions::Distribution(Int32)

Samples a random variable with the given distribution.