[mareframe] Annotation of /trunk/gadget/multinomial.h
Annotation of /trunk/gadget/multinomial.h
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
1 : |
agomez |
1 |
#ifndef multinomial_h
|
2 : |
|
|
#define multinomial_h
|
3 : |
|
|
|
4 : |
|
|
#include "doublevector.h" |
5 : |
|
|
|
6 : |
|
|
/**
|
7 : |
|
|
* \class Multinomial
|
8 : |
|
|
* \brief This is the class that calculates a log likelihood score by comparing 2 vectors based on a multinomial distribution
|
9 : |
|
|
*/
|
10 : |
|
|
class Multinomial {
|
11 : |
|
|
public:
|
12 : |
|
|
/**
|
13 : |
|
|
* \brief This is the default Multinomial constructor
|
14 : |
|
|
*/
|
15 : |
|
|
Multinomial() { bigvalue = 0.0; loglikelihood = 0.0; };
|
16 : |
|
|
/**
|
17 : |
|
|
* \brief This is the default Multinomial destructor
|
18 : |
|
|
*/
|
19 : |
|
|
~Multinomial() {};
|
20 : |
|
|
/**
|
21 : |
|
|
* \brief This function will set the minimum probability value
|
22 : |
|
|
* \param value is the bigvalue used to calculate the minimum probabilty
|
23 : |
|
|
*/
|
24 : |
|
|
void setValue(double value) { bigvalue = value; };
|
25 : |
|
|
/**
|
26 : |
|
|
* \brief This function will reset the log likelihood score
|
27 : |
|
|
*/
|
28 : |
|
|
void Reset() { loglikelihood = 0.0; };
|
29 : |
|
|
/**
|
30 : |
|
|
* \brief This is the function that calculates a log likelihood score by comparing 2 vectors based on a multinomial distribution
|
31 : |
|
|
* \param data is the DoubleVector containing the input data
|
32 : |
|
|
* \param dist is the DoubleVector containing the modelled data
|
33 : |
|
|
* \return likelihood
|
34 : |
|
|
*/
|
35 : |
|
|
double calcLogLikelihood(const DoubleVector& data, const DoubleVector& dist);
|
36 : |
|
|
/**
|
37 : |
|
|
* \brief This will return the log likelihood score
|
38 : |
|
|
* \return loglikelihood
|
39 : |
|
|
*/
|
40 : |
|
|
double getLogLikelihood() const { return loglikelihood; };
|
41 : |
|
|
protected:
|
42 : |
|
|
/**
|
43 : |
|
|
* \brief This is used to calculate the default minimum probability for unlikely values
|
44 : |
|
|
*/
|
45 : |
|
|
double bigvalue;
|
46 : |
|
|
/**
|
47 : |
|
|
* \brief This is the log likelihood score
|
48 : |
|
|
*/
|
49 : |
|
|
double loglikelihood;
|
50 : |
|
|
};
|
51 : |
|
|
|
52 : |
|
|
#endif
|
|