Clair::RandomDistribution

Poisson


SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods

SummaryTop
Clair::RandomDistribution::Poisson

Package variablesTop
No package variables defined.

Included modulesTop
Carp
Clair::RandomDistribution::RandomDistributionBase

InheritTop
Clair::RandomDistribution::RandomDistributionBase

SynopsisTop
my $z = Clair::RandomDistribution::Poisson->new(lambda => 5, dist_size => 50);

DescriptionTop
Concrete class representing a Poisson distributions.

MethodsTop
dist_functionDescriptionCode
newNo descriptionCode

Methods description


dist_functioncode    nextTop
Takes a random variable

Methods code


dist_functiondescriptionprevnextTop
sub dist_function {
  my $self = shift;
  return (($self->{lambda} ** $_[0]) * exp (-$self->{lambda})) /
factorial (
$_[0]);
}

newdescriptionprevnextTop
sub new {
  my $class = shift;
  my %params = @_;

  # We require a lambda parameter (a positive real number, equal to
# the expected number of occurrences on the given interval)
unless ((exists $params{lambda}) && ($params{lambda} > 0)) { croak "Poisson dist requires positive lambda parameter\n"; } # Instantiate our base class/create representation
$params{dist_name} = "Poisson"; my $self = $class->new_distribution (%params); return $self;
}

General documentation


No general documentation available.