Quantile of F-distribution

Hello! I have boost libraries and I need quantile of F-distribution.
But unfortunatelty I've havent found an example of it on the internet.
As for the normal distribution it was
 ``123`` ``````#include boost::math::normal dist(0.0, 1.0); double z = quantile(dist, 1-5/100);``````

For F-distribution it should be someting like that with two degree of fredom and probability.
 ``123`` ``````#include boost::math::fisher_f dist(0.0, 1.0); double z = quantile(dist, 0.95);``````

Looked up to this link https://www.boost.org/doc/libs/1_69_0/libs/math/doc/html/math_toolkit/dist_ref/dists/f_dist.html but unfortunately I've haven't understood how two write two seconds lines for quntile of f distributions.
I need some help. Thanks in advance!
Last edited on
 ``123456789101112`` ``````#include #include using namespace std; using boost::math::fisher_f; int main() { double df1 = 5, df2 = 2; // degrees of freedom double p = 0.8; // cumulative probability fisher_f dist(df1, df2); // distribution object with appropriate deg. freedom cout << "quantile(" << p << ") = " << quantile(dist, p); }``````

Blimey, I never knew cpp.sh had boost!!! That's a well-kept secret!
Last edited on
Registered users can post here. Sign in or register to post.