Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
uniformDistribution.h
1 #ifndef uniformDistribution_H
2 #define uniformDistribution_H
3 
4 #include "Distribution.h"
5 
10 class uniformDistribution : public virtual Distribution {
11 
12  public:
16  uniformDistribution( double, double );
17 
18 private:
19  double _valInf;
20  double _valSup;
21  double _span;
22  bool _isConstant;
24 public:
25  // accessors to specific variables
31  double valInf();
37  double valSup();
38 
39  public: // probabilistic member functions
43  double mean();
47  double rate();
51  double moment( int order );
55  double variance();
59  double laplace( double s );
63  double dLaplace( double s ); // derivative of the Laplace transform
67  double cdf( double x );
71  double ccdf( double x );
75  bool hasMoment( int order);
76 
80  uniformDistribution *rescale( double factor );
88  double sample();
92  void iidSample( int n, double* s );
93 
94  public:
98  std::string toString();
102  void write( FILE *out, int mode );
103 
104 };
105 
106 #endif // uniformDistribution_H
double valInf()
Read accessor to the lower end of the interval.
double ccdf(double x)
computing the complementary cumulative distributon function (or tail) at some real point x...
void iidSample(int n, double *s)
drawing an i.i.d. sample from the distribution. The result is returned in an array (that must have be...
Definition: uniformDistribution.cpp:224
uniformDistribution(double, double)
standard constructor from extremities of the interval
Definition: uniformDistribution.cpp:28
A class for representing probability distributions.
Definition: Distribution.h:44
std::string toString()
an utility to convert the distribution into a string.
Definition: uniformDistribution.cpp:177
void write(FILE *out, int mode)
an utility to write the distribution to some file, according to some format.
Definition: uniformDistribution.cpp:164
double cdf(double x)
computing the cumulative distribution function at some real point x. This is the probability that the...
Definition: uniformDistribution.cpp:146
The continuous uniform distribution over some interval.
Definition: uniformDistribution.h:25
double moment(int order)
Computing the moments of the distribution.
Definition: uniformDistribution.cpp:75
double rate()
computing the "rate", defined as the inverse of the mean
Definition: uniformDistribution.cpp:57
uniformDistribution * rescale(double factor)
rescaling a distribution by some real factor. Not all distributions allow this for any real factor...
Definition: uniformDistribution.cpp:191
double variance()
Computing the variance of the random variable: the second moment minus the square of the first moment...
uniformDistribution * copy()
copying a distribution. Typically implemented as rescale(1.0).
Definition: uniformDistribution.cpp:204
double dLaplace(double s)
computing the derivative of the Laplace transform at real points
Definition: uniformDistribution.cpp:124
bool hasMoment(int order)
test for the existence of moments of any order
Definition: uniformDistribution.cpp:96
double valSup()
Read accessor to the upper end of the interval.
double mean()
computing the mathematical expectation or mean
Definition: uniformDistribution.cpp:48
double laplace(double s)
computing the Laplace transform of the distribution at real point
Definition: uniformDistribution.cpp:104
double sample()
drawing a (pseudo)random value according to the distribution.
Definition: uniformDistribution.cpp:214