yat  0.21pre
Classes | Public Member Functions | List of all members
theplu::yat::statistics::NegativeBinomialMixture Class Reference

#include <yat/statistics/NegativeBinomialMixture.h>

Public Member Functions

void add (unsigned long int k, unsigned long int n=1)
 
const utility::VectorBasealpha (void) const
 
void clear (void)
 remove all data
 
void fit (size_t n)
 
void fit (const utility::VectorBase &m, const utility::VectorBase &alpha, const utility::VectorBase &tau)
 
double logL (void) const
 
double pdf (unsigned long int k) const
 
double pdf (unsigned long int k, size_t i) const
 
const utility::VectorBasem (void) const
 
const utility::VectorBasetau (void) const
 

Detailed Description

Data is modeled as a mixture of negative binomial distributions and the likelihood is calculated as

$ L = \sum_i \tau_i L_i = \sum_i \tau_i {k+r_i-1 \choose r_i-1} (1-p_i)^{r_i} p_i^k $ where $ \sum_i \tau_i = 1.0 $.

Since
New in yat 0.20

Member Function Documentation

◆ add()

void theplu::yat::statistics::NegativeBinomialMixture::add ( unsigned long int  k,
unsigned long int  n = 1 
)

Add n data points with value k

◆ alpha()

const utility::VectorBase& theplu::yat::statistics::NegativeBinomialMixture::alpha ( void  ) const

The alpha values are defined as $ alpha = \frac{1}{1-p} $

◆ fit() [1/2]

void theplu::yat::statistics::NegativeBinomialMixture::fit ( size_t  n)

Fit the data to a model with n sub-distributions.

◆ fit() [2/2]

void theplu::yat::statistics::NegativeBinomialMixture::fit ( const utility::VectorBase m,
const utility::VectorBase alpha,
const utility::VectorBase tau 
)

Fit the data initiating the search for the optimal model parameters at the values passed.

◆ logL()

double theplu::yat::statistics::NegativeBinomialMixture::logL ( void  ) const
Returns
log likelihood of getting data given inferred model

◆ m()

const utility::VectorBase& theplu::yat::statistics::NegativeBinomialMixture::m ( void  ) const

The mean is calculated as $ m = \frac{pr}{1-p} $

Returns
the mean of each sub-distribution

◆ pdf() [1/2]

double theplu::yat::statistics::NegativeBinomialMixture::pdf ( unsigned long int  k) const

Probabily to get k from the inferred model.

◆ pdf() [2/2]

double theplu::yat::statistics::NegativeBinomialMixture::pdf ( unsigned long int  k,
size_t  i 
) const

Probability to get k from the ith model

◆ tau()

const utility::VectorBase& theplu::yat::statistics::NegativeBinomialMixture::tau ( void  ) const
Returns
tau values in model, describing how much each sub-distribution contributes to the total distribution.

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

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14