dist_reference.qbk 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. [section:dist_ref Statistical Distributions Reference]
  2. [include non_members.qbk]
  3. [section:dists Distributions]
  4. [include arcsine.qbk]
  5. [include bernoulli.qbk]
  6. [include beta.qbk]
  7. [include binomial.qbk]
  8. [include cauchy.qbk]
  9. [include chi_squared.qbk]
  10. [include empirical_cdf.qbk]
  11. [include exponential.qbk]
  12. [include extreme_value.qbk]
  13. [include fisher.qbk]
  14. [include gamma.qbk]
  15. [include geometric.qbk]
  16. [include hyperexponential.qbk]
  17. [include hypergeometric.qbk]
  18. [include inverse_chi_squared.qbk]
  19. [include inverse_gamma.qbk]
  20. [include inverse_gaussian.qbk]
  21. [include laplace.qbk]
  22. [include logistic.qbk]
  23. [include lognormal.qbk]
  24. [include negative_binomial.qbk]
  25. [include nc_beta.qbk]
  26. [include nc_chi_squared.qbk]
  27. [include nc_f.qbk]
  28. [include nc_t.qbk]
  29. [include normal.qbk]
  30. [include pareto.qbk]
  31. [include poisson.qbk]
  32. [include rayleigh.qbk]
  33. [include skew_normal.qbk]
  34. [include students_t.qbk]
  35. [include triangular.qbk]
  36. [include uniform.qbk]
  37. [include weibull.qbk]
  38. [endsect] [/section:dists Distributions]
  39. [include dist_algorithms.qbk]
  40. [endsect] [/section:dist_ref Statistical Distributions and Functions Reference]
  41. [section:future Extras/Future Directions]
  42. [h4 Adding Additional Location and Scale Parameters]
  43. In some modelling applications we require a distribution
  44. with a specific location and scale:
  45. often this equates to a specific mean and standard deviation, although for many
  46. distributions the relationship between these properties and the location and
  47. scale parameters are non-trivial. See
  48. [@http://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm http://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm]
  49. for more information.
  50. The obvious way to handle this is via an adapter template:
  51. template <class Dist>
  52. class scaled_distribution
  53. {
  54. scaled_distribution(
  55. const Dist dist,
  56. typename Dist::value_type location,
  57. typename Dist::value_type scale = 0);
  58. };
  59. Which would then have its own set of overloads for the non-member accessor functions.
  60. [h4 An "any_distribution" class]
  61. It is easy to add a distribution object that virtualises
  62. the actual type of the distribution, and can therefore hold "any" object
  63. that conforms to the conceptual requirements of a distribution:
  64. template <class RealType>
  65. class any_distribution
  66. {
  67. public:
  68. template <class Distribution>
  69. any_distribution(const Distribution& d);
  70. };
  71. // Get the cdf of the underlying distribution:
  72. template <class RealType>
  73. RealType cdf(const any_distribution<RealType>& d, RealType x);
  74. // etc....
  75. Such a class would facilitate the writing of non-template code that can
  76. function with any distribution type.
  77. The [@http://sourceforge.net/projects/distexplorer/ Statistical Distribution Explorer]
  78. utility for Windows is a usage example.
  79. It's not clear yet whether there is a compelling use case though.
  80. Possibly tests for goodness of fit might
  81. provide such a use case: this needs more investigation.
  82. [h4 Higher Level Hypothesis Tests]
  83. Higher-level tests roughly corresponding to the
  84. [@http://documents.wolfram.com/mathematica/Add-onsLinks/StandardPackages/Statistics/HypothesisTests.html Mathematica Hypothesis Tests]
  85. package could be added reasonably easily, for example:
  86. template <class InputIterator>
  87. typename std::iterator_traits<InputIterator>::value_type
  88. test_equal_mean(
  89. InputIterator a,
  90. InputIterator b,
  91. typename std::iterator_traits<InputIterator>::value_type expected_mean);
  92. Returns the probability that the data in the sequence \[a,b) has the mean
  93. /expected_mean/.
  94. [h4 Integration With Statistical Accumulators]
  95. [@http://boost-sandbox.sourceforge.net/libs/accumulators/doc/html/index.html
  96. Eric Niebler's accumulator framework] - also work in progress - provides the means
  97. to calculate various statistical properties from experimental data. There is an
  98. opportunity to integrate the statistical tests with this framework at some later date:
  99. // Define an accumulator, all required statistics to calculate the test
  100. // are calculated automatically:
  101. accumulator_set<double, features<tag::test_expected_mean> > acc(expected_mean=4);
  102. // Pass our data to the accumulator:
  103. acc = std::for_each(mydata.begin(), mydata.end(), acc);
  104. // Extract the result:
  105. double p = probability(acc);
  106. [endsect] [/section:future Extras Future Directions]
  107. [/ dist_reference.qbk
  108. Copyright 2006, 2010 John Maddock and Paul A. Bristow.
  109. Distributed under the Boost Software License, Version 1.0.
  110. (See accompanying file LICENSE_1_0.txt or copy at
  111. http://www.boost.org/LICENSE_1_0.txt).
  112. ]