Subject: [Boost-bugs] [Boost C++ Libraries] #8308: Poisson Quantile function returns wrong results in certain cases
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-18 23:56:16
#8308: Poisson Quantile function returns wrong results in certain cases
----------------------------------+-----------------------------------------
Reporter: Caleb.Welton@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: math
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
----------------------------------+-----------------------------------------
Sample use case:
{{{
main() {
double pi = 3.1415927;
boost::math::poisson poisson(pi);
// std::cout << quantile(poisson, 0.00) << " ";
std::cout << quantile(poisson, 0.05) << " ";
std::cout << quantile(poisson, 0.30) << " ";
std::cout << quantile(poisson, pi/6) << " ";
std::cout << quantile(poisson, 0.7) << " ";
std::cout << quantile(poisson, 1-1e-10) << " ";
// std:: cout << quantile(poisson, 1) << std::endl;
}
}}}
Produces the results
(error), 0, 1, 3, 4, 20, (error)
Similar code in R or MATLAB results in: (0),1,2,3,4,20,(Inf)
{{{
R> qpois(c(0,0.05,0.3,pi/6,0.7,1-1e-10,1),pi)
[1] 0 1 2 3 4 20 Inf
MATLAB> f := stats::poissonQuantile(PI):
MATLAB> f(0), f(1/20), f(0.3), f(PI/6), f(0.7), f(1-1/10^10), f(1)
0,1,2,3,4,20,Inf
}}}
The errors on the edge cases are less troubling than the seemingly
incorrect results at low probabilities.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8308> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC