OpenMS  2.4.0
Static Public Member Functions | List of all members
CumulativeBinomial Class Reference

Computes the cumulative binomial function. More...

#include <OpenMS/MATH/STATISTICS/CumulativeBinomial.h>

Static Public Member Functions

static double compute (Size n, Size k, double p)
 Compute the cumulative binomial function. More...
 

Detailed Description

Computes the cumulative binomial function.

Member Function Documentation

◆ compute()

static double compute ( Size  n,
Size  k,
double  p 
)
static

Compute the cumulative binomial function.

Sums up ( n choose i ) * p^i * (1-p)^(n-i) for i from 0 to k.

Note
if the binomial coefficient ( n choose k ) overflows, it is set to the numeric limit for the double type
Parameters
n,sizeof theoretical spectrum
k,numberof matched peaks
p,probabilityof a random match between a theoretical and an experimental peak