16 #ifndef DISCRETEDISTRIBUTION_H
17 #define DISCRETEDISTRIBUTION_H
19 #include "Distribution.h"
154 double moment(
int order );
169 double cdf(
double x );
231 void write( FILE *out,
int mode );
235 #endif // DISCRETEDISTRIBUTION_H
void write(FILE *out, int mode)
Printing a representation of the law.
Definition: discreteDistribution.cpp:269
bool hasMoment(int order)
Test of existence of a moment. These distributions always have one.
Definition: discreteDistribution.cpp:203
double * _values
Definition: discreteDistribution.h:84
double distanceL2(discreteDistribution *d)
Computes the L2 distance between two distributions. In case of incompatible or infinite sizes...
Definition: discreteDistribution.cpp:433
double distanceLinfinity(discreteDistribution *d)
Computes the L-infinity distance between two distributions. In case of incompatible or infinite sizes...
Definition: discreteDistribution.cpp:462
int _nbVals
Definition: discreteDistribution.h:83
std::string name()
Read accessor to the type name of the distribution.
Definition: Distribution.h:66
double mean()
Calculation of the mean. Returns the value since it is pre-computed.
Definition: discreteDistribution.h:142
A class for representing probability distributions.
Definition: Distribution.h:44
discreteDistribution * copy()
copying a distribution. Typically implemented as rescale(1.0).
Definition: discreteDistribution.cpp:353
int nbVals()
Read accessor to the number of values in the distribution.
Definition: discreteDistribution.h:122
std::string toString()
Printing a representation of the law into a string.
Definition: discreteDistribution.cpp:307
bool setProba(int i, double v)
Write accessor for the probas. This is a pseudo-accessor since it performs additional checks...
Definition: discreteDistribution.cpp:155
discreteDistribution * rescale(double factor)
rescaling a distribution by some real factor. Not all distributions allow this for any real factor...
Definition: discreteDistribution.cpp:332
double getValue(int i)
Read accessor for the values. This is a pseudo-accessor since it performs additional checks...
Definition: discreteDistribution.cpp:137
virtual double distanceL1(Distribution *d)
Computing generally the L1 distance between distributions.
Definition: Distribution.cpp:53
double getProbaByIndex(int i)
Read accessor for the elements of the probas array. This is a pseudo-accessor since it performs addit...
Definition: discreteDistribution.cpp:105
~discreteDistribution()
Destructor for a general discrete distribution. The convention is that internal arrays for values and...
Definition: discreteDistribution.cpp:96
double getProba(double value)
Computes the probability of a particular value. The tolerance VALUE_TOLERANCE is applied to match val...
Definition: discreteDistribution.cpp:123
double laplace(double s)
computing the Laplace transform of the distribution at real point
Definition: discreteDistribution.cpp:214
double cdf(double x)
Computation of the cumulative density function at some real point x.
Definition: discreteDistribution.cpp:250
double moment(int order)
Computing the moments of the distribution.
Definition: discreteDistribution.cpp:190
double sample()
Sampling from the law This is the straightforward, non optimized, linear-time algorithm.
Definition: discreteDistribution.cpp:366
double distanceL1(discreteDistribution *d)
Computes the L1 distance between this distribution and another one. In case of incompatible or infini...
Definition: discreteDistribution.cpp:386
double dLaplace(double s)
computing the derivative of the Laplace transform at real points
Definition: discreteDistribution.cpp:232
double _mean
Definition: Distribution.h:240
double * _probas
Definition: discreteDistribution.h:85
double rate()
Calculation of the rate, which is the inverse of the mean. If the mean is 0, the value INFINITE_RATE ...
Definition: discreteDistribution.cpp:174
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25