Steffen Müller >
Statistics-EfficiencyCI-0.07 >
Statistics::EfficiencyCI

Module Version: 0.07
Statistics::EfficiencyCI - Robust confidence intervals on efficiencies

use Statistics::EfficiencyCI qw(efficiency_ci); my $confidence_level = 0.683; my ($mode, $lower_cl, $upper_cl) = efficiency_ci($k, $N, $confidence_level); # With default confidence level of "1sigma" == 0.683 my ($mode, $lower_cl, $upper_cl) = efficiency_ci($k, $N);

This module implements robust confidence interval calculations on efficiency-like quantities. The algorithm is explained in the note by Marc Paterno linked in the references below.

The employed method does not suffer from the usual boundary issue of the uncertainty calculation based on the Binomial model: At an efficiency `e = k/N`

with small `k`

, the confidence interval will be asymmetric and will not go below `0`

, which the simple calculation based on the Binomial PDF will for confidence levels above the equivalent of one sigma. It also does not suffer from the problem that the uncertainty vanishes at `k=0`

and `k=N`

.

Beside the `efficiency_ci`

function, this module exposes the approximation to the logarithm of the Gamma function that it uses internally. It takes a floating point number as argument and returns the calculated `log(Gamma(x))`

. For negative integers, it returns `undef`

.

This module will optionally export the `efficiency_ci`

and `log_gamma`

functions.

By default, the module's functions warn if there's something wrong (max iterations reached, etc). Set the global variable `$Statistics::EfficiencyCI::Exceptions`

to a true value (hopefully using `local`

) to upgrade the warnings to exceptions.

Marc Paterno's note on calculating the uncertainty on an efficiency: :<http://home.fnal.gov/~paterno/images/effic.pdf>

The ROOT library's website: http://root.cern.ch

Author of the Perl glue code is Steffen Mueller, <smueller@cpan.org>.

Author of the method of calculating the confidence intervals and its implementation is Marc Paterno.

Copyright (C) 2011-2014 by Steffen Mueller

Most of the code is taken from the ROOT library (licensed under LGPL) and by proxy, the CEPHES library (licensed with a modified BSD license). The full list of ROOT authors can be found on the ROOT website http://root.cern.ch.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL). You can find a full copy of the license in the *LICENSE* file in this distribution.

syntax highlighting: