升压位数函数(C ++) [英] Quantile functions in boost (C++)
问题描述
从文档提振来看,似乎提供正常和Gamma分布分位数函数(CDF反函数),但它不是我清楚,我怎么可以实际使用它们。可能有人贴一个例子吗?
Judging from the documentation boost seems to offer quantile functions (inverse cdf functions) for both normal and gamma distributions, but its not clear for me how can I actually use them. Could someone paste an example please?
推荐答案
分位数计算实现为一个自由的功能。这里有一个例子:
The quantile calculation is implemented as a free function. Here's an example:
#include <boost/math/distributions/normal.hpp>
boost::math::normal dist(0.0, 1.0);
// 95% of distribution is below q:
double q = quantile(dist, 0.95);
您也可以使用get(右位数)补:
You can also get the complement (quantile from the right) using:
// 95% of distribution is above qc:
double qc = quantile(complement(dist, 0.05));
有一些类似工作的例子在这里:
There are some similar worked examples here:
<一个href=\"http://www.boost.org/doc/libs/1_46_1/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg.html\">http://www.boost.org/doc/libs/1_46_1/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg.html
编辑:不需要感谢ADL免费功能上的命名空间。
don't need namespaces on the free functions thanks to ADL
这篇关于升压位数函数(C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!