poisson.qbk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. [section:poisson_dist Poisson Distribution]
  2. ``#include <boost/math/distributions/poisson.hpp>``
  3. namespace boost { namespace math {
  4. template <class RealType = double,
  5. class ``__Policy`` = ``__policy_class`` >
  6. class poisson_distribution;
  7. typedef poisson_distribution<> poisson;
  8. template <class RealType, class ``__Policy``>
  9. class poisson_distribution
  10. {
  11. public:
  12. typedef RealType value_type;
  13. typedef Policy policy_type;
  14. poisson_distribution(RealType mean = 1); // Constructor.
  15. RealType mean()const; // Accessor.
  16. }
  17. }} // namespaces boost::math
  18. The [@http://en.wikipedia.org/wiki/Poisson_distribution Poisson distribution]
  19. is a well-known statistical discrete distribution.
  20. It expresses the probability of a number of events
  21. (or failures, arrivals, occurrences ...)
  22. occurring in a fixed period of time,
  23. provided these events occur with a known mean rate [lambda]
  24. (events/time), and are independent of the time since the last event.
  25. The distribution was discovered by Sim[eacute]on-Denis Poisson (1781 to 1840).
  26. It has the Probability Mass Function:
  27. [equation poisson_ref1]
  28. for k events, with an expected number of events [lambda].
  29. The following graph illustrates how the PDF varies with the parameter [lambda]:
  30. [graph poisson_pdf_1]
  31. [discrete_quantile_warning Poisson]
  32. [h4 Member Functions]
  33. poisson_distribution(RealType mean = 1);
  34. Constructs a poisson distribution with mean /mean/.
  35. RealType mean()const;
  36. Returns the /mean/ of this distribution.
  37. [h4 Non-member Accessors]
  38. All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
  39. distributions are supported: __usual_accessors.
  40. The domain of the random variable is \[0, [infin]\].
  41. [h4 Accuracy]
  42. The Poisson distribution is implemented in terms of the
  43. incomplete gamma functions __gamma_p and __gamma_q
  44. and as such should have low error rates: but refer to the documentation
  45. of those functions for more information.
  46. The quantile and its complement use the inverse gamma functions
  47. and are therefore probably slightly less accurate: this is because the
  48. inverse gamma functions are implemented using an iterative method with a
  49. lower tolerance to avoid excessive computation.
  50. [h4 Implementation]
  51. In the following table [lambda] is the mean of the distribution,
  52. /k/ is the random variable, /p/ is the probability and /q = 1-p/.
  53. [table
  54. [[Function][Implementation Notes]]
  55. [[pdf][Using the relation: pdf = e[super -[lambda]] [lambda][super k] \/ k! ]]
  56. [[cdf][Using the relation: p = [Gamma](k+1, [lambda]) \/ k! = __gamma_q(k+1, [lambda])]]
  57. [[cdf complement][Using the relation: q = __gamma_p(k+1, [lambda]) ]]
  58. [[quantile][Using the relation: k = __gamma_q_inva([lambda], p) - 1]]
  59. [[quantile from the complement][Using the relation: k = __gamma_p_inva([lambda], q) - 1]]
  60. [[mean][[lambda]]]
  61. [[mode][ floor ([lambda]) or [floorlr[lambda]] ]]
  62. [[skewness][1/[radic][lambda]]]
  63. [[kurtosis][3 + 1/[lambda]]]
  64. [[kurtosis excess][1/[lambda]]]
  65. ]
  66. [endsect] [/section:poisson_dist Poisson]
  67. [/ poisson.qbk
  68. Copyright 2006 John Maddock and Paul A. Bristow.
  69. Distributed under the Boost Software License, Version 1.0.
  70. (See accompanying file LICENSE_1_0.txt or copy at
  71. http://www.boost.org/LICENSE_1_0.txt).
  72. ]