#include <boost/math/distributions/poisson.hpp>
namespace boost { namespace math { template <class RealType = double, class Policy = policies::policy<> > class poisson_distribution; typedef poisson_distribution<> poisson; template <class RealType, class Policy> class poisson_distribution { public: typedef RealType value_type; typedef Policy policy_type; poisson_distribution(RealType mean = 1); // Constructor. RealType mean()const; // Accessor. } }} // namespaces boost::math The Poisson distribution is a well-known statistical discrete distribution. It expresses the probability of a number of events (or failures, arrivals, occurrences ...) occurring in a fixed period of time, provided these events occur with a known mean rate λ (events/time), and are independent of the time since the last event. The distribution was discovered by Sim? on-Denis Poisson (1781 to 1840). It has the Probability Mass Function:
for k events, with an expected number of events λ. The following graph illustrates how the PDF varies with the parameter λ:
Member Functionspoisson_distribution(RealType mean = 1); Constructs a poisson distribution with mean mean. RealType mean()const; Returns the mean of this distribution. Non-member AccessorsAll the usual non-member accessor functions that are generic to all distributions are supported: Cumulative Distribution Function, Probability Density Function, Quantile, Hazard Function, Cumulative Hazard Function, mean, median, mode, variance, standard deviation, skewness, kurtosis, kurtosis_excess, range and support. The domain of the random variable is [0, ∞]. AccuracyThe Poisson distribution is implemented in terms of the incomplete gamma functions gamma_p and gamma_q and as such should have low error rates: but refer to the documentation of those functions for more information. The quantile and its complement use the inverse gamma functions and are therefore probably slightly less accurate: this is because the inverse gamma functions are implemented using an iterative method with a lower tolerance to avoid excessive computation. ImplementationIn the following table λ is the mean of the distribution, k is the random variable, p is the probability and q = 1-p.
|