Fisher F complemented quantile fails for two upper-tail probabilities
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 15/100
Research direction
The reproducer calls quantile(complement(...)) on fisher_f_distribution<double, Policy> with promotion disabled. Start by running the provided C++17 example against the Boost.Math include directory and compare both results with the stated reference values. Done means the first probability returns approximately 5.272596610651114e306 and the second overflows to positive infinity; a linked pull request is already open.
Written by the indexing model from the issue text.
Description
quantile(complement(fisher_f_distribution<double>(1, 0.1), q)) gives incorrect results for two upper-tail probabilities with promotion disabled. I reproduced this on Windows x64 with MSVC in C++17 mode, using Boost.Math commit 8b9e21b41a45443d8f77ad84295b2f372c9e2c19 from SciPy’s Boost upgrade PR.
q |
Expected from 100-digit reference | Actual |
|---|---|---|
3.85e-16 |
5.272596610651114e306 |
halley_iterate<double> throws because no root was found |
1e-20 |
+inf because the quantile exceeds the double range |
4.4942328371557913e306 |
Compile with BOOST_MATH_STANDALONE=1 and the Boost.Math include directory on the include path.
#include <boost/math/distributions/fisher_f.hpp>
#include <boost/math/policies/policy.hpp>
#include <exception>
#include <iomanip>
#include <initializer_list>
#include <iostream>
int main() {
using namespace boost::math;
using Policy = policies::policy<
policies::promote_float<false>,
policies::promote_double<false>,
policies::max_root_iterations<400>,
policies::overflow_error<policies::ignore_error>>;
const fisher_f_distribution<double, Policy> dist(1, 0.1);
std::cout << std::setprecision(17);
for (double q : {3.85e-16, 1e-20}) {
try {
const double x = quantile(complement(dist, q));
std::cout << q << " -> " << x << '\n';
} catch (const std::exception& e) {
std::cout << q << " -> " << e.what() << '\n';
}
}
}
I will open a PR for it myself.
- Dominant language
- C++
- Stars
- 382
- Forks
- 274
- Avg merge
- 21h 14m
- Merged PRs (30d)
- 51
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/math
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Feature WishlistOpenenhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
boostorg/math#303 · 20 comments ·
Maintainers usually reply within 1 day
Similar issues
-
agent:WSL code-review linux pri:medium refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
kind/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
psi29a/d2decomped#691 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CachyOS/packageinstaller#144 ·
Maintainers usually reply within 1 day
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CleverRaven/Cataclysm-DDA#89715 ·
Maintainers usually reply within 1 day