pareto.qbk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. [section:pareto Pareto Distribution]
  2. ``#include <boost/math/distributions/pareto.hpp>``
  3. namespace boost{ namespace math{
  4. template <class RealType = double,
  5. class ``__Policy`` = ``__policy_class`` >
  6. class pareto_distribution;
  7. typedef pareto_distribution<> pareto;
  8. template <class RealType, class ``__Policy``>
  9. class pareto_distribution
  10. {
  11. public:
  12. typedef RealType value_type;
  13. // Constructor:
  14. pareto_distribution(RealType scale = 1, RealType shape = 1)
  15. // Accessors:
  16. RealType scale()const;
  17. RealType shape()const;
  18. };
  19. }} // namespaces
  20. The [@http://en.wikipedia.org/wiki/pareto_distribution Pareto distribution]
  21. is a continuous distribution with the
  22. [@http://en.wikipedia.org/wiki/Probability_density_function probability density function (pdf)]:
  23. [expression f(x; [alpha], [beta]) = [alpha][beta][super [alpha]] / x[super [alpha]+ 1]]
  24. For shape parameter [alpha] > 0, and scale parameter [beta] > 0.
  25. If x < [beta], the pdf is zero.
  26. The [@http://mathworld.wolfram.com/ParetoDistribution.html Pareto distribution]
  27. often describes the larger compared to the smaller.
  28. A classic example is that 80% of the wealth is owned by 20% of the population.
  29. The following graph illustrates how the PDF varies with the scale parameter [beta]:
  30. [graph pareto_pdf1]
  31. And this graph illustrates how the PDF varies with the shape parameter [alpha]:
  32. [graph pareto_pdf2]
  33. [h4 Related distributions]
  34. [h4 Member Functions]
  35. pareto_distribution(RealType scale = 1, RealType shape = 1);
  36. Constructs a [@http://en.wikipedia.org/wiki/pareto_distribution
  37. pareto distribution] with shape /shape/ and scale /scale/.
  38. Requires that the /shape/ and /scale/ parameters are both greater than zero,
  39. otherwise calls __domain_error.
  40. RealType scale()const;
  41. Returns the /scale/ parameter of this distribution.
  42. RealType shape()const;
  43. Returns the /shape/ parameter of this distribution.
  44. [h4 Non-member Accessors]
  45. All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
  46. distributions are supported: __usual_accessors.
  47. The supported domain of the random variable is \[scale, [infin]\].
  48. [h4 Accuracy]
  49. The Pareto distribution is implemented in terms of the
  50. standard library `exp` functions plus __expm1
  51. and so should have very small errors, usually only a few epsilon.
  52. If probability is near to unity (or the complement of a probability near zero) see also __why_complements.
  53. [h4 Implementation]
  54. In the following table [alpha] is the shape parameter of the distribution, and
  55. [beta] is its scale parameter, /x/ is the random variate, /p/ is the probability
  56. and its complement /q = 1-p/.
  57. [table
  58. [[Function][Implementation Notes]]
  59. [[pdf][Using the relation: pdf p = [alpha][beta][super [alpha]]/x[super [alpha] +1] ]]
  60. [[cdf][Using the relation: cdf p = 1 - ([beta] / x)[super [alpha]] ]]
  61. [[cdf complement][Using the relation: q = 1 - p = -([beta] / x)[super [alpha]] ]]
  62. [[quantile][Using the relation: x = [beta] / (1 - p)[super 1/[alpha]] ]]
  63. [[quantile from the complement][Using the relation: x = [beta] / (q)[super 1/[alpha]] ]]
  64. [[mean][[alpha][beta] / ([beta] - 1) ]]
  65. [[variance][[beta][alpha][super 2] / ([beta] - 1)[super 2] ([beta] - 2) ]]
  66. [[mode][[alpha]]]
  67. [[skewness][Refer to [@http://mathworld.wolfram.com/ParetoDistribution.html Weisstein, Eric W. "Pareto Distribution." From MathWorld--A Wolfram Web Resource.] ]]
  68. [[kurtosis][Refer to [@http://mathworld.wolfram.com/ParetoDistribution.html Weisstein, Eric W. "Pareto Distribution." From MathWorld--A Wolfram Web Resource.] ]]
  69. [[kurtosis excess][Refer to [@http://mathworld.wolfram.com/ParetoDistribution.html Weisstein, Eric W. "pareto Distribution." From MathWorld--A Wolfram Web Resource.] ]]
  70. ]
  71. [h4 References]
  72. * [@http://en.wikipedia.org/wiki/pareto_distribution Pareto Distribution]
  73. * [@http://mathworld.wolfram.com/paretoDistribution.html Weisstein, Eric W. "Pareto Distribution." From MathWorld--A Wolfram Web Resource.]
  74. * Handbook of Statistical Distributions with Applications, K Krishnamoorthy, ISBN 1-58488-635-8, Chapter 23, pp 257 - 267.
  75. (Note the meaning of a and b is reversed in Wolfram and Krishnamoorthy).
  76. [endsect] [/section:pareto pareto]
  77. [/
  78. Copyright 2006, 2009 John Maddock and Paul A. Bristow.
  79. Distributed under the Boost Software License, Version 1.0.
  80. (See accompanying file LICENSE_1_0.txt or copy at
  81. http://www.boost.org/LICENSE_1_0.txt).
  82. ]