16 #ifndef geometricDistribution_H
17 #define geometricDistribution_H
19 #include "Distribution.h"
58 double p() {
return _p; }
84 double moment(
int order );
99 double cdf(
double x );
142 void write( FILE *out,
int mode );
146 #endif // geometricDistribution_H
double sample()
Sampling from the distribution. The method uses the fact that the integer part of an exponential rand...
Definition: geometricDistribution.cpp:266
double laplace(double s)
computing the Laplace transform of the distribution at real point
Definition: geometricDistribution.cpp:146
double dLaplace(double s)
computing the derivative of the Laplace transform at real points
Definition: geometricDistribution.cpp:162
double cdf(double x)
Definition: geometricDistribution.cpp:181
geometricDistribution * rescale(double factor)
Rescaling the distribution. Geometric distributions cannot be rescaled. A copy is returned...
Definition: geometricDistribution.cpp:243
A class for representing probability distributions.
Definition: Distribution.h:44
geometricDistribution(double p)
Unique constructor for the class, from its "ratio".
Definition: geometricDistribution.cpp:29
std::string toString()
Definition: geometricDistribution.cpp:230
The geometric distribution with starting value 0. The parameter "p" is called "ratio". The Geometric distribution is discrete but does not inherit from discreteDistribution because its range is infinite.
Definition: geometricDistribution.h:28
double rate()
Definition: geometricDistribution.cpp:68
double p()
Function to obtain the parameter (or ratio) of the distribution. Redundant with p() but defined to be...
Definition: geometricDistribution.h:58
double moment(int order)
Computing the moments of the distribution.
Definition: geometricDistribution.cpp:89
double getRatio()
Function to obtain the parameter (or ratio) of the distribution. Redundant with getRatio() but define...
Definition: geometricDistribution.h:65
double mean()
Function to obtain the mean (expectation). Its value is 1/(1-_p)
Definition: geometricDistribution.cpp:57
bool hasMoment(int order)
Test of existence of a moment. These distributions always have one.
Definition: geometricDistribution.cpp:135
double getProba(double k)
Function to obtain the probability of a specific value k.
Definition: geometricDistribution.cpp:198
geometricDistribution * copy()
copying a distribution. Typically implemented as rescale(1.0).
Definition: geometricDistribution.cpp:258
void write(FILE *out, int mode)
Definition: geometricDistribution.cpp:211