yat  0.14.5pre
Public Member Functions | List of all members
theplu::yat::statistics::LikelihoodRatioTestBinomial Class Reference

Likelihood-ratio test for binomial data. More...

#include <yat/statistics/LikelihoodRatioTestBinomial.h>

Public Member Functions

 LikelihoodRatioTestBinomial (size_t n=2)
 constructor More...
 
void add (size_t population, bool positive, long int n=1)
 add one data point More...
 
unsigned long int n (void) const
 
unsigned long int n (size_t i) const
 
unsigned long int negative (void) const
 
unsigned long int negative (size_t i) const
 
unsigned long int positive (void) const
 
unsigned long int positive (size_t i) const
 
size_t size (void) const
 
double llr (void) const
 Calculate natural logarithm of likelihood ratios. More...
 

Detailed Description

Likelihood-ratio test for binomial data.

This class is useful when having binomial data for several populations and especially comparing the frequency in the differen samples.

Constructor & Destructor Documentation

theplu::yat::statistics::LikelihoodRatioTestBinomial::LikelihoodRatioTestBinomial ( size_t  n = 2)

constructor

Parameters
nnumber of populations in data

Member Function Documentation

void theplu::yat::statistics::LikelihoodRatioTestBinomial::add ( size_t  population,
bool  positive,
long int  n = 1 
)

add one data point

Parameters
populationfrom which population the data point comes from.
positiveif true data point is positive.
nhow many data points added
double theplu::yat::statistics::LikelihoodRatioTestBinomial::llr ( void  ) const

Calculate natural logarithm of likelihood ratios.

The logairithm of the likelihood ratio is calculated as $ LLR = \sum_i \left ( n_{i+} \ln \frac{n_{i+}}{n_i} + n_{i-} \ln \frac{n_{i-}}{n_i} \right ) - \left ( n_+ \ln \frac{n_+}{n} + n_- \ln \frac{n_-}{n} \right ) $

unsigned long int theplu::yat::statistics::LikelihoodRatioTestBinomial::n ( void  ) const
Returns
Number of data points
unsigned long int theplu::yat::statistics::LikelihoodRatioTestBinomial::n ( size_t  i) const
Returns
Number of data points from population i
unsigned long int theplu::yat::statistics::LikelihoodRatioTestBinomial::negative ( void  ) const
Returns
Number of negative data points
unsigned long int theplu::yat::statistics::LikelihoodRatioTestBinomial::negative ( size_t  i) const
Returns
Number of negative data points from population i
unsigned long int theplu::yat::statistics::LikelihoodRatioTestBinomial::positive ( void  ) const
Returns
Number of data points
unsigned long int theplu::yat::statistics::LikelihoodRatioTestBinomial::positive ( size_t  i) const
Returns
Number of positive data points from population i
size_t theplu::yat::statistics::LikelihoodRatioTestBinomial::size ( void  ) const
Returns
Number of populations

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

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5