#include using namespace boost::math; int main() { double events, lo, hi; for(events=1; events<=20; events += 0.5) { inverse_chi_squared_distribution<> dist_hi(2*events); hi = 1 / (quantile(complement(dist_hi, 0.975)) * 2); inverse_chi_squared_distribution<> dist_lo(2*(events+1)); lo = 1 / (quantile(complement(dist_lo, 0.025)) * 2); printf("events: %5.1f 2.5%% limit: %5.2f 97.5%% limit: %5.2f\n", events, lo, hi); } return 0; } /* ---------------------------------- EOF ---------------------------------- */