Boost C++ Libraries: Ticket #12407: typos/bugs in arcsine CDF and support? https://svn.boost.org/trac10/ticket/12407 <p> Hi, I have two questions/corrections regarding the arcsine distribution. </p> <ol><li>On the website </li></ol><p> <a href="http://www.boost.org/doc/libs/1_61_0/libs/math/doc/html/math_toolkit/dist_ref/dists/arcine_dist.html">http://www.boost.org/doc/libs/1_61_0/libs/math/doc/html/math_toolkit/dist_ref/dists/arcine_dist.html</a> in the main text, the formula for CDF contains a bug. Instead of F(x) = 2⋅arcsin(√((x-x_min)/(x_max - x))) / π it should be F(x) = 2⋅arcsin(√((x-x_min)/(x_max - x_min))) / π </p> <p> Note that the CDF is is correctly displayed in the 'Implementation' box F(x) = 2/π⋅sin-1(√(x - a) / (b - a) ) </p> <ol start="2"><li>Should the support be (0,1) instead of <a class="source" href="https://svn.boost.org/trac10/log/?revs=0-1">[0,1]</a>, see e.g. </li></ol><p> <a class="ext-link" href="http://www.math.uah.edu/stat/special/Arcsine.html"><span class="icon">​</span>http://www.math.uah.edu/stat/special/Arcsine.html</a> </p> <p> Best Regards, Maciej </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12407 Trac 1.4.3 Michel Morin Fri, 26 Aug 2016 13:36:54 GMT owner, component changed https://svn.boost.org/trac10/ticket/12407#comment:1 https://svn.boost.org/trac10/ticket/12407#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">John Maddock</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">math</span> </li> </ul> Ticket John Maddock Sat, 27 Aug 2016 18:06:51 GMT cc, status changed; resolution set https://svn.boost.org/trac10/ticket/12407#comment:2 https://svn.boost.org/trac10/ticket/12407#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">pbristow@…</span> added </li> <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> Thanks I've fixed the typo in Git. </p> <p> WRT to the second question, Wikipedia has support over <a class="source" href="https://svn.boost.org/trac10/log/?revs=0-1">[0,1]</a>, and indeed PDF and CDF are perfectly calculable there, albeit the PDF is infinite at the limits. So I guess this comes down to taste? </p> Ticket Paul A. Bristow Mon, 29 Aug 2016 09:03:29 GMT <link>https://svn.boost.org/trac10/ticket/12407#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12407#comment:3</guid> <description> <p> Sorry to come late to this (been away). I think we can probably provide support for <a class="source" href="https://svn.boost.org/trac10/log/?revs=0-1">[0,1]</a>. I'll check this out and say when I've done that (or decided why not). Won't be in the upcoming release, but will be committed to develop as soon as the release is out in case you wanted to pick up earlier. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 29 Aug 2016 11:38:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12407#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12407#comment:4</guid> <description> <p> Paul, I think you have this the wrong way around: we *do* support the end points of the range already, the argument was that these should actually be undefined... but different sources seem to have different views on that. </p> <p> John. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Paul A. Bristow</dc:creator> <pubDate>Tue, 30 Aug 2016 10:49:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12407#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12407#comment:5</guid> <description> <p> OK - I said I'd do some homework, and I have, starting with reading the original post and grabbing hold of the right end of the stick ;-) </p> <p> <a class="ext-link" href="https://reference.wolfram.com/language/ref/ArcSinDistribution.html"><span class="icon">​</span>https://reference.wolfram.com/language/ref/ArcSinDistribution.html</a> warns of "PDF ... potential singularities (where it asymptotically approaches infinity) at points near both xmin and xmax" but is quiet about what happens at the max and min. </p> <p> So I agree with John on this issue, and supporting [0, 1] is consistent with other Boost math implementations. </p> <p> I think it provides the most convenient match of the infinite precision math to the digital floating-point implementation. We signal the singularity by returning infinity rather than throwing an exception (or whatever) to the input. We think this is commonly convenient for users. </p> <p> Users can very easily intercept values that are at the min or max before the PDF or CDF call if they wish to catch and handle this in some different way. </p> </description> <category>Ticket</category> </item> </channel> </rss>