Boost C++ Libraries: Ticket #8837: boost::math::students_t quantile() fails for huge degrees of freedom https://svn.boost.org/trac10/ticket/8837 <p> Student's t quantile function calls policies::raise_rounding_error() in iround() when degrees of freedom = 4503599627370496. </p> <p> boost::math::students_t students(4503599627370496); double dRes = quantile(students, 0.4); </p> <p> If this is disabled using #define BOOST_MATH_ROUNDING_ERROR_POLICY ignore_error in user.hpp the computation will continue. </p> <p> The function inverse_students_t_hill() uses the test ndf &gt; 1e20 to use the Standard Normal approximation, but Boost subsequently attempts to refine the estimate using the Halley step in fast_students_t_quantile_imp() and this becomes unreliable and eventually fails for huge dof such as dof = DBL_MAX (results in completely wrong result) or +Infinity (returns a NaN). </p> <p> For consistency, I suggest the quantile function us the same threshold as pdf() and cdf() to approximate the Student's t with the standard normal distribution when dof &gt; 1/eps. </p> <p> I will attempt to attach my user.hpp file. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8837 Trac 1.4.3 Paul McClellan <paulm@…> Wed, 17 Jul 2013 16:35:35 GMT attachment set https://svn.boost.org/trac10/ticket/8837 https://svn.boost.org/trac10/ticket/8837 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">user.hpp</span> </li> </ul> <p> user.hpp file for policies </p> Ticket John Maddock Thu, 18 Jul 2013 17:31:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8837#comment:1 https://svn.boost.org/trac10/ticket/8837#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85075" title="Don't throw exceptions from itrunc/iround if all we're doing is ...">[85075]</a>) Don't throw exceptions from itrunc/iround if all we're doing is checking to see if the argument is an integer. Don't propagate no-throw policies inside MPFR's itrunc/iround. Use normal approximation to student's t quantile when the degrees of freedom is big enough. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8837" title="#8837: Bugs: boost::math::students_t quantile() fails for huge degrees of freedom (closed: fixed)">#8837</a>. </p> Ticket John Maddock Sat, 28 Sep 2013 16:19:56 GMT <link>https://svn.boost.org/trac10/ticket/8837#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8837#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85987" title="Merge accumulated patches from Trunk. Refs #8384, Refs #8855, refs ...">[85987]</a>) Merge accumulated patches from Trunk. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8384" title="#8384: Feature Requests: Make shared_ptr movable (closed: invalid)">#8384</a>, Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8855" title="#8855: Bugs: [math] GCC 4.8+ warns unused local typedef... (closed: fixed)">#8855</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9107" title="#9107: Bugs: unused parameter warning in fraction with clang (closed: fixed)">#9107</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9109" title="#9109: Bugs: Warning in bessel with -Wshadow (closed: fixed)">#9109</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8333" title="#8333: Bugs: [math] PGI 11.3 problems (sph_bessel.cpp, sph_bessel.cpp) (closed: fixed)">#8333</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8621" title="#8621: Bugs: erf function gives wrong results with pgcpp - PGI 10.4 (closed: fixed)">#8621</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8732" title="#8732: Bugs: Need to protect calls against C99 math macro expansion (closed: fixed)">#8732</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8733" title="#8733: Feature Requests: Testing for unprotected references to C99 math macros (closed: fixed)">#8733</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8837" title="#8837: Bugs: boost::math::students_t quantile() fails for huge degrees of freedom (closed: fixed)">#8837</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8940" title="#8940: Bugs: Argument promotion fails dependent libs on platforms not supporting ... (closed: fixed)">#8940</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9042" title="#9042: Bugs: boost::math, cdf(complement(normal_distribution&lt;&gt;(...)) fails to catch ... (closed: fixed)">#9042</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9087" title="#9087: Support Requests: [boost math] error: no operator &#34;=&#34; matches these operands in ... (closed: fixed)">#9087</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9104" title="#9104: Bugs: boost::math::ellint_2 bug in x86_64 double precision (closed: fixed)">#9104</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9126" title="#9126: Bugs: Logistic distribution pdf() and cdf(complement()) fail to catch ... (closed: fixed)">#9126</a>. </p> </description> <category>Ticket</category> </item> </channel> </rss>