AudibleT 0.0.1
A real-time A/B/X audio testing tool for subjective assessment of various audio parameters, compatible for general purpose computer as well as embedded systems.
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members

Provides functions for binomial distribution calculations. More...

#include <BinomialHelper.h>

Static Public Member Functions

static double logFactorial (int n)
 Calculates the natural logarithm of the factorial of an integer.
 
static double logCombination (int n, int k)
 Calculates the natural logarithm of the combination of n items taken k at a time.
 
static int combination (int n, int k)
 Calculates the combination of n items taken k at a time.
 
static double binomialProbability (int n, int k, double p)
 Calculates the binomial probability.
 
static double binomialCDF (int n, int k, double p)
 Calculates the cumulative distribution function (CDF) for a binomial distribution.
 
static int inverseBinomialCDF (double targetP, int n, double p)
 Calculates the inverse of the binomial CDF.
 

Detailed Description

Provides functions for binomial distribution calculations.

Member Function Documentation

◆ binomialCDF()

double BinomialHelper::binomialCDF ( int  n,
int  k,
double  p 
)
static

Calculates the cumulative distribution function (CDF) for a binomial distribution.

Parameters
nThe number of trials.
kThe number of successes.
pThe probability of success on a single trial.
Returns
The cumulative probability of getting up to k successes in n trials.

◆ binomialProbability()

double BinomialHelper::binomialProbability ( int  n,
int  k,
double  p 
)
static

Calculates the binomial probability.

Parameters
nThe number of trials.
kThe number of successes.
pThe probability of success on a single trial.
Returns
The binomial probability of getting k successes in n trials.

◆ combination()

int BinomialHelper::combination ( int  n,
int  k 
)
static

Calculates the combination of n items taken k at a time.

Parameters
nThe total number of items.
kThe number of items to choose.
Returns
The combination of n items taken k at a time.

◆ inverseBinomialCDF()

int BinomialHelper::inverseBinomialCDF ( double  targetP,
int  n,
double  p 
)
static

Calculates the inverse of the binomial CDF.

Parameters
targetPThe target cumulative probability.
nThe number of trials.
pThe probability of success on a single trial.
Returns
The smallest number of successes such that the CDF is greater than or equal to targetP.

◆ logCombination()

double BinomialHelper::logCombination ( int  n,
int  k 
)
static

Calculates the natural logarithm of the combination of n items taken k at a time.

Parameters
nThe total number of items.
kThe number of items to choose.
Returns
The natural logarithm of the combination of n items taken k at a time.

◆ logFactorial()

double BinomialHelper::logFactorial ( int  n)
static

Calculates the natural logarithm of the factorial of an integer.

Parameters
nThe integer.
Returns
The natural logarithm of the factorial of n.

The documentation for this class was generated from the following files: