25#ifndef quantlib_poisson_distribution_hpp
26#define quantlib_poisson_distribution_hpp
28#include <ql/math/factorial.hpp>
29#include <ql/math/incompletegamma.hpp>
129 "mu must be non negative (" <<
mu_ <<
" not allowed)");
136 if (k==0)
return 1.0;
140 return std::exp(k*std::log(
mu_) - logFactorial -
mu_);
146 QL_REQUIRE(
lambda_ > 0.0,
"lambda must be positive");
150 QL_REQUIRE(x >= 0.0 && x <= 1.0,
151 "Inverse cumulative Poisson distribution is "
152 "only defined on the interval [0,1]");
164 return Real(index-1);
Cumulative Poisson distribution function.
Real operator()(BigNatural k) const
QL_DEPRECATED typedef Real argument_type
QL_DEPRECATED typedef Real result_type
CumulativePoissonDistribution(Real mu)
static Real get(Natural n)
static Real ln(Natural n)
Inverse cumulative Poisson distribution function.
Real operator()(Real x) const
Real calcSummand(BigNatural index) const
InverseCumulativePoisson(Real lambda=1.0)
QL_DEPRECATED typedef Real argument_type
QL_DEPRECATED typedef Real result_type
Poisson distribution function.
Real operator()(BigNatural k) const
QL_DEPRECATED typedef Real argument_type
PoissonDistribution(Real mu)
QL_DEPRECATED typedef Real result_type
QL_INTEGER Integer
integer number
Real incompleteGammaFunction(Real a, Real x, Real accuracy, Integer maxIteration)
Incomplete Gamma function.
unsigned QL_BIG_INTEGER BigNatural
large positive integer