From 7786c7d5a854c2e98df5423dcd0d3dc21480c8dc Mon Sep 17 00:00:00 2001 From: pabristow Date: Tue, 9 Aug 2016 16:05:20 +0100 Subject: [PATCH] Added Thomas Luu references --- doc/distributions/nc_chi_squared.qbk | 73 ++++++++++--------- doc/html/index.html | 2 +- doc/html/indexes/s01.html | 2 +- doc/html/indexes/s02.html | 2 +- doc/html/indexes/s03.html | 2 +- doc/html/indexes/s04.html | 2 +- doc/html/indexes/s05.html | 2 +- doc/html/math_toolkit/conventions.html | 2 +- doc/html/math_toolkit/credits.html | 17 +++++ .../dist_ref/dists/nc_chi_squared_dist.html | 5 +- doc/html/math_toolkit/history1.html | 15 ++-- doc/html/math_toolkit/history2.html | 15 ++-- doc/html/math_toolkit/navigation.html | 2 +- doc/overview/credits.qbk | 15 +++- doc/overview/roadmap.qbk | 5 +- .../distributions/non_central_chi_squared.hpp | 7 +- 16 files changed, 107 insertions(+), 61 deletions(-) diff --git a/doc/distributions/nc_chi_squared.qbk b/doc/distributions/nc_chi_squared.qbk index af5c84a34..a1c2a32dc 100644 --- a/doc/distributions/nc_chi_squared.qbk +++ b/doc/distributions/nc_chi_squared.qbk @@ -2,9 +2,9 @@ ``#include `` - namespace boost{ namespace math{ + namespace boost{ namespace math{ - template class non_central_chi_squared_distribution; @@ -30,26 +30,26 @@ static RealType find_degrees_of_freedom(RealType lambda, RealType x, RealType p); template static RealType find_degrees_of_freedom(const complemented3_type& c); - + static RealType find_non_centrality(RealType v, RealType x, RealType p); template static RealType find_non_centrality(const complemented3_type& c); }; - + }} // namespaces - -The noncentral chi-squared distribution is a generalization of the -__chi_squared_distrib. If X[sub i] are [nu] independent, normally -distributed random variables with means [mu][sub i] and variances + +The noncentral chi-squared distribution is a generalization of the +__chi_squared_distrib. If X[sub i] are [nu] independent, normally +distributed random variables with means [mu][sub i] and variances [sigma][sub i][super 2], then the random variable [equation nc_chi_squ_ref1] -is distributed according to the noncentral chi-squared distribution. +is distributed according to the noncentral chi-squared distribution. -The noncentral chi-squared distribution has two parameters: -[nu] which specifies the number of degrees of freedom -(i.e. the number of X[sub i]), and [lambda] which is related to the +The noncentral chi-squared distribution has two parameters: +[nu] which specifies the number of degrees of freedom +(i.e. the number of X[sub i]), and [lambda] which is related to the mean of the random variables X[sub i] by: [equation nc_chi_squ_ref2] @@ -60,7 +60,7 @@ This leads to a PDF of: [equation nc_chi_squ_ref3] -where ['f(x;k)] is the central chi-squared distribution PDF, and +where ['f(x;k)] is the central chi-squared distribution PDF, and ['I[sub v](x)] is a modified Bessel function of the first kind. The following graph illustrates how the distribution changes @@ -71,18 +71,18 @@ for different values of [lambda]: [h4 Member Functions] non_central_chi_squared_distribution(RealType v, RealType lambda); - + Constructs a Chi-Squared distribution with /v/ degrees of freedom and non-centrality parameter /lambda/. Requires v > 0 and lambda >= 0, otherwise calls __domain_error. RealType degrees_of_freedom()const; - + Returns the parameter /v/ from which this object was constructed. RealType non_centrality()const; - + Returns the parameter /lambda/ from which this object was constructed. @@ -93,14 +93,14 @@ This function returns the number of degrees of freedom /v/ such that: template static RealType find_degrees_of_freedom(const complemented3_type& c); - -When called with argument `boost::math::complement(lambda, x, q)` + +When called with argument `boost::math::complement(lambda, x, q)` this function returns the number of degrees of freedom /v/ such that: `cdf(complement(non_central_chi_squared(v, lambda), x)) == q`. static RealType find_non_centrality(RealType v, RealType x, RealType p); - + This function returns the non centrality parameter /lambda/ such that: `cdf(non_central_chi_squared(v, lambda), x) == p` @@ -122,8 +122,8 @@ The domain of the random variable is \[0, +[infin]\]. [h4 Examples] -There is a -[link math_toolkit.stat_tut.weg.nccs_eg worked example] +There is a +[link math_toolkit.stat_tut.weg.nccs_eg worked example] for the noncentral chi-squared distribution. [h4 Accuracy] @@ -140,9 +140,9 @@ than the one shown will have __zero_error. [table_non_central_chi_squared_CDF_complement] -Error rates for the quantile +Error rates for the quantile functions are broadly similar. Special mention should go to -the `mode` function: there is no closed form for this function, +the `mode` function: there is no closed form for this function, so it is evaluated numerically by finding the maxima of the PDF: in principal this can not produce an accuracy greater than the square root of the machine epsilon. @@ -151,10 +151,10 @@ square root of the machine epsilon. There are two sets of test data used to verify this implementation: firstly we can compare with published data, for example with -Table 6 of "Self-Validating Computations of Probabilities for +Table 6 of "Self-Validating Computations of Probabilities for Selected Central and Noncentral Univariate Probability Functions", Morgan C. Wang and William J. Kennedy, -Journal of the American Statistical Association, +Journal of the American Statistical Association, Vol. 89, No. 427. (Sep., 1994), pp. 878-887. Secondly, we have tables of test data, computed with this implementation and using interval arithmetic - this data should @@ -180,8 +180,8 @@ is then subtracted from 1 to give the desired result (the CDF or its complement). For small values of the non centrality parameter, the CDF is computed -using the method of Ding (see "Algorithm AS 275: Computing the Non-Central -#2 Distribution Function", Cherng G. Ding, Applied Statistics, Vol. 41, +using the method of Ding (see "Algorithm AS 275: Computing the Non-Central +#2 Distribution Function", Cherng G. Ding, Applied Statistics, Vol. 41, No. 2. (1992), pp. 478-482). This uses the following series representation: [equation nc_chi_squ_ref4] @@ -195,10 +195,10 @@ the largest term is not the first term, so in extreme cases the first term may be zero, leading to a zero result, even though the true value may be non-zero. Therefore, when the non-centrality parameter is greater than 200, the method due -to Krishnamoorthy (see "Computing discrete mixtures of continuous distributions: -noncentral chisquare, noncentral t and the distribution of the -square of the sample multiple correlation coefficient", -Denise Benton and K. Krishnamoorthy, Computational Statistics & +to Krishnamoorthy (see "Computing discrete mixtures of continuous distributions: +noncentral chisquare, noncentral t and the distribution of the +square of the sample multiple correlation coefficient", +Denise Benton and K. Krishnamoorthy, Computational Statistics & Data Analysis, 43, (2003), 249-267) is used. This method uses the well known sum: @@ -232,16 +232,19 @@ The PDF is computed directly using the relation: [equation nc_chi_squ_ref3] -Where ['f(x; v)] is the PDF of the central __chi_squared_distrib and -['I[sub v](x)] is a modified Bessel function, see __cyl_bessel_i. +Where ['f(x; v)] is the PDF of the central __chi_squared_distrib and +['I[sub v](x)] is a modified Bessel function, see __cyl_bessel_i. For small values of the non-centrality parameter the relation in terms of __cyl_bessel_i is used. However, this method fails for large values of the -non-centrality parameter, so in that case the infinite sum is -evaluated using the method of Benton and Krishnamoorthy, and +non-centrality parameter, so in that case the infinite sum is +evaluated using the method of Benton and Krishnamoorthy, and the usual recurrence relations for successive terms. The quantile functions are computed by numeric inversion of the CDF. +An improve starting quess is from +Thomas Luu, +[@http://discovery.ucl.ac.uk/1482128/, Fast and accurate parallel computation of quantile functions for random number generation, Doctorial Thesis, 2016]. There is no [@http://en.wikipedia.org/wiki/Closed_form closed form] for the mode of the noncentral chi-squared diff --git a/doc/html/index.html b/doc/html/index.html index c76d26115..9e4df8392 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -116,7 +116,7 @@ This manual is also available in -

Last revised: August 03, 2016 at 18:01:01 GMT

+

Last revised: August 09, 2016 at 14:52:49 GMT


diff --git a/doc/html/indexes/s01.html b/doc/html/indexes/s01.html index f1a02333a..e3751dd52 100644 --- a/doc/html/indexes/s01.html +++ b/doc/html/indexes/s01.html @@ -24,7 +24,7 @@

-Function Index

+Function Index

2 4 A B C D E F G H I J K L M N O P Q R S T U V X Y Z

diff --git a/doc/html/indexes/s02.html b/doc/html/indexes/s02.html index 86e6faecc..0153ac76d 100644 --- a/doc/html/indexes/s02.html +++ b/doc/html/indexes/s02.html @@ -24,7 +24,7 @@

-Class Index

+Class Index

A B C D E F G H I L M N O P Q R S T U W

diff --git a/doc/html/indexes/s03.html b/doc/html/indexes/s03.html index 53411c4d5..d43ceb248 100644 --- a/doc/html/indexes/s03.html +++ b/doc/html/indexes/s03.html @@ -24,7 +24,7 @@

-Typedef Index

+Typedef Index

A B C D E F G H I L N O P R S T U V W

diff --git a/doc/html/indexes/s04.html b/doc/html/indexes/s04.html index ca4e082bc..e4b73dc6d 100644 --- a/doc/html/indexes/s04.html +++ b/doc/html/indexes/s04.html @@ -24,7 +24,7 @@

-Macro Index

+Macro Index

B F

diff --git a/doc/html/indexes/s05.html b/doc/html/indexes/s05.html index c28b4a4da..bab4247e6 100644 --- a/doc/html/indexes/s05.html +++ b/doc/html/indexes/s05.html @@ -23,7 +23,7 @@

-Index

+Index

2 4 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

diff --git a/doc/html/math_toolkit/conventions.html b/doc/html/math_toolkit/conventions.html index 99e537677..cab779d45 100644 --- a/doc/html/math_toolkit/conventions.html +++ b/doc/html/math_toolkit/conventions.html @@ -27,7 +27,7 @@ Document Conventions

- +

This documentation aims to use of the following naming and formatting conventions. diff --git a/doc/html/math_toolkit/credits.html b/doc/html/math_toolkit/credits.html index d7ace1c42..7fb3552d6 100644 --- a/doc/html/math_toolkit/credits.html +++ b/doc/html/math_toolkit/credits.html @@ -153,6 +153,23 @@

Jeremy William Murphy added polynomial arithmetic tools.

+

+ Thomas Luu provided improvements to the quantile of the non-central chi squared + distribution quantile. and his thesis * Fast + and accurate parallel computation of quantile functions for random number generation, + 2016. +

+

+ and his paper +

+

+ Luu, Thomas; (2015), Efficient and Accurate Parallel Inversion of the Gamma + Distribution, SIAM Journal on Scientific Computing , 37 (1) C122 - C141, http://dx.doi.org/10.1137/14095875X. +

+

+ These also promise to help improve algorithms for computation of quantile of + several disitributions, especially for parallel computation using GPUs. +

diff --git a/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html b/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html index 7cf323b7b..f16f4c6e7 100644 --- a/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html @@ -527,7 +527,10 @@ and Krishnamoorthy, and the usual recurrence relations for successive terms.

- The quantile functions are computed by numeric inversion of the CDF. + The quantile functions are computed by numeric inversion of the CDF. An + improve starting quess is from Thomas Luu, Fast + and accurate parallel computation of quantile functions for random number + generation, Doctorial Thesis, 2016.

There is no closed diff --git a/doc/html/math_toolkit/history1.html b/doc/html/math_toolkit/history1.html index fa8b34f1c..40eea3ac6 100644 --- a/doc/html/math_toolkit/history1.html +++ b/doc/html/math_toolkit/history1.html @@ -419,15 +419,18 @@ over/underflow.

  • +

    Add improvement to non-central chi squared distribution quantile due to - Thomas Luu. -

  • - + Thomas Luu, Fast and accurate + parallel computation of quantile functions for random number generation, + Doctorial Thesis 2016. Efficient + and Accurate Parallel Inversion of the Gamma Distribution, Thomas Luu +

    - Boost-1.54 -
    -
      + Boost-1.54 + +
    • Major reorganization to incorporate other Boost.Math like Integer Utilities Integer Utilities (Greatest Common Divisor and Least Common Multiple), diff --git a/doc/html/math_toolkit/history2.html b/doc/html/math_toolkit/history2.html index c899e7362..80fe1fa81 100644 --- a/doc/html/math_toolkit/history2.html +++ b/doc/html/math_toolkit/history2.html @@ -419,15 +419,18 @@ over/underflow.
    • +

      Add improvement to non-central chi squared distribution quantile due to - Thomas Luu. -

    • -
    + Thomas Luu, Fast and accurate + parallel computation of quantile functions for random number generation, + Doctorial Thesis 2016. Efficient + and Accurate Parallel Inversion of the Gamma Distribution, Thomas Luu +

    - Boost-1.54 -
    -
      + Boost-1.54 + +
    • Major reorganization to incorporate other Boost.Math like Integer Utilities Integer Utilities (Greatest Common Divisor and Least Common Multiple), diff --git a/doc/html/math_toolkit/navigation.html b/doc/html/math_toolkit/navigation.html index a724dda0e..c657abb69 100644 --- a/doc/html/math_toolkit/navigation.html +++ b/doc/html/math_toolkit/navigation.html @@ -27,7 +27,7 @@ Navigation

    - +

    Boost.Math documentation is provided in both HTML and PDF formats. diff --git a/doc/overview/credits.qbk b/doc/overview/credits.qbk index 0a2b8a510..252e0b611 100644 --- a/doc/overview/credits.qbk +++ b/doc/overview/credits.qbk @@ -110,10 +110,23 @@ special functions code to near destruction! Jeremy William Murphy added polynomial arithmetic tools. +Thomas Luu provided improvements to the quantile of the non-central chi squared distribution quantile. +and his thesis +* [@http://discovery.ucl.ac.uk/1482128/ Fast and accurate parallel computation of quantile functions for random number generation, 2016]. + +and his paper + +Luu, Thomas; (2015), Efficient and Accurate Parallel Inversion of the Gamma Distribution, +SIAM Journal on Scientific Computing , 37 (1) C122 - C141, +[@http://dx.doi.org/10.1137/14095875X]. + +These also promise to help improve algorithms for computation of quantile of several disitributions, +especially for parallel computation using GPUs. + [endsect] [/section:credits Credits and Acknowledgements] [/ - Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2015 John Maddock and Paul A. Bristow. + Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2015, 2016 John Maddock and Paul A. Bristow. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). diff --git a/doc/overview/roadmap.qbk b/doc/overview/roadmap.qbk index e268d33ff..8a12bf846 100644 --- a/doc/overview/roadmap.qbk +++ b/doc/overview/roadmap.qbk @@ -142,8 +142,9 @@ Random variate can now be infinite. * Improve consistency of argument reduction in the elliptic integrals [@https://svn.boost.org/trac/boost/ticket/9104 #9104]. * Fix bug in inverse incomplete beta that results in cancellation errors when the beta function is really an arcsine or Student's T distribution. * Fix issue in Bessel I and K function continued fractions that causes spurious over/underflow. -* Add improvement to non-central chi squared distribution quantile due to Thomas Luu. - +* Add improvement to non-central chi squared distribution quantile due to Thomas Luu, +[@http://discovery.ucl.ac.uk/1482128/ Fast and accurate parallel computation of quantile functions for random number generation, Doctorial Thesis 2016]. +[@http://discovery.ucl.ac.uk/1463470/ Efficient and Accurate Parallel Inversion of the Gamma Distribution, Thomas Luu] [h4 Boost-1.54] * Major reorganization to incorporate other Boost.Math like Integer Utilities Integer Utilities (Greatest Common Divisor and Least Common Multiple), quaternions and octonions. diff --git a/include/boost/math/distributions/non_central_chi_squared.hpp b/include/boost/math/distributions/non_central_chi_squared.hpp index 97f87ed4c..038d951b0 100644 --- a/include/boost/math/distributions/non_central_chi_squared.hpp +++ b/include/boost/math/distributions/non_central_chi_squared.hpp @@ -438,7 +438,7 @@ namespace boost return comp ? 0 : policies::raise_overflow_error(function, 0, Policy()); // // This is Pearson's approximation to the quantile, see - // Pearson, E. S. (1959) "Note on an approximation to the distribution of + // Pearson, E. S. (1959) "Note on an approximation to the distribution of // noncentral chi squared", Biometrika 46: 364. // See also: // "A comparison of approximations to percentiles of the noncentral chi2-distribution", @@ -460,10 +460,13 @@ namespace boost // // Sometimes guess goes very small or negative, in that case we have // to do something else for the initial guess, this approximation - // was provided in a private communication from Thomas Luu, PhD candidate, + // was provided in a private communication from Thomas Luu, PhD candidate, // University College London. It's an asymptotic expansion for the // quantile which usually gets us within an order of magnitude of the // correct answer. + // Fast and accurate parallel computation of quantile functions for random number generation, + // Thomas LuuDoctorial Thesis 2016 + // http://discovery.ucl.ac.uk/1482128/ // if(guess < 0.005) {