1 #ifndef DISCRETEDISTRIBUTION_H
2 #define DISCRETEDISTRIBUTION_H
4 #include "Distribution.h"
130 double moment(
int order );
145 double cdf(
double x );
207 void write( FILE *out,
int mode );
211 #endif // DISCRETEDISTRIBUTION_H
void write(FILE *out, int mode)
Printing a representation of the law.
Definition: discreteDistribution.cpp:255
double * _values
Definition: discreteDistribution.h:84
bool hasMoment(int order)
Test of existence of a moment. These distributions always have one.
Definition: discreteDistribution.cpp:189
double distanceL2(discreteDistribution *d)
Computes the L2 distance between two distributions. In case of incompatible or infinite sizes...
Definition: discreteDistribution.cpp:419
double distanceLinfinity(discreteDistribution *d)
Computes the L-infinity distance between two distributions. In case of incompatible or infinite sizes...
Definition: discreteDistribution.cpp:448
int _nbVals
Definition: discreteDistribution.h:83
std::string name()
Read accessor to the type name of the distribution.
Definition: Distribution.h:66
double * _probas
Definition: discreteDistribution.h:85
double mean()
Calculation of the mean. Returns the value since it is pre-computed.
Definition: discreteDistribution.h:118
A class for representing probability distributions.
Definition: Distribution.h:44
discreteDistribution * copy()
copying a distribution. Typically implemented as rescale(1.0).
Definition: discreteDistribution.cpp:339
int nbVals()
Read accessor to the number of values in the distribution.
Definition: discreteDistribution.h:98
std::string toString()
Printing a representation of the law into a string.
Definition: discreteDistribution.cpp:293
bool setProba(int i, double v)
Write accessor for the probas. This is a pseudo-accessor since it performs additional checks...
Definition: discreteDistribution.cpp:141
discreteDistribution * rescale(double factor)
rescaling a distribution by some real factor. Not all distributions allow this for any real factor...
Definition: discreteDistribution.cpp:318
double getValue(int i)
Read accessor for the values. This is a pseudo-accessor since it performs additional checks...
Definition: discreteDistribution.cpp:123
virtual double distanceL1(Distribution *d)
Computing generally the L1 distance between distributions.
Definition: Distribution.cpp:51
~discreteDistribution()
Destructor for a general discrete distribution. The convention is that internal arrays for values and...
Definition: discreteDistribution.cpp:96
double laplace(double s)
computing the Laplace transform of the distribution at real point
Definition: discreteDistribution.cpp:200
double cdf(double x)
Computation of the cumulative density function at some real point x.
Definition: discreteDistribution.cpp:236
double moment(int order)
Computing the moments of the distribution.
Definition: discreteDistribution.cpp:176
double sample()
Sampling from the law This is the straightforward, non optimized, linear-time algorithm.
Definition: discreteDistribution.cpp:352
double getProba(int i)
Read accessor for the probas. This is a pseudo-accessor since it performs additional checks...
Definition: discreteDistribution.cpp:105
double distanceL1(discreteDistribution *d)
Computes the L1 distance between this distribution and another one. In case of incompatible or infini...
Definition: discreteDistribution.cpp:372
double dLaplace(double s)
computing the derivative of the Laplace transform at real points
Definition: discreteDistribution.cpp:218
double _mean
Definition: Distribution.h:239
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:160
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25