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