Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
exponentialDistribution.h
1 #ifndef EXPONENTIALDISTRIBUTION_H
2 #define EXPONENTIALDISTRIBUTION_H
3 
4 #include "discreteDistribution.h"
5 
10 class exponentialDistribution : public virtual Distribution {
11 
12 public:
13  // constructors
20  exponentialDistribution( double val ); // creation from a value
21 
22 private:
23  // specific variables
24  double _rate;
26 public:
27  // accessors
33  double rate() { return _rate; }
34 
35 public:
36  // probabilistic member functions
42  double mean() { return _mean; };
43 
47  double moment( int order );
51  double laplace( double s ); // Laplace transform at real points
55  double dLaplace( double s ); // derivative of the Laplace transform
59  double cdf( double x );
66  bool hasMoment( int order );
67 
71  exponentialDistribution *rescale( double factor );
76 
82  double sample();
83 
84  public:
90  std::string toString();
97  void write( FILE *out, int mode );
98 
99 };
100 
101 #endif // EXPONENTIALDISTRIBUTION_H
double sample()
Sampling from the law. Uses the mother class method.
Definition: exponentialDistribution.cpp:176
double mean()
Calculation of the mean. Returns the value since it is pre-computed.
Definition: exponentialDistribution.h:42
The class representing the (negative) exponential distribution.
Definition: exponentialDistribution.h:25
exponentialDistribution * copy()
copying a distribution. Typically implemented as rescale(1.0).
Definition: exponentialDistribution.cpp:168
std::string toString()
Printing a representation of the law into a string.
Definition: exponentialDistribution.cpp:146
double cdf(double x)
computing the cumulative distribution function at some real point x. This is the probability that the...
Definition: exponentialDistribution.cpp:111
A class for representing probability distributions.
Definition: Distribution.h:44
double moment(int order)
Computing the moments of the distribution.
Definition: exponentialDistribution.cpp:42
exponentialDistribution * rescale(double factor)
rescaling a distribution by some real factor. Not all distributions allow this for any real factor...
Definition: exponentialDistribution.cpp:158
bool hasMoment(int order)
Test of existence of a moment. These distributions always have one.
Definition: exponentialDistribution.cpp:73
exponentialDistribution(double val)
Unique constructor for the exponential distribution, from its average. The rate is computed at creati...
Definition: exponentialDistribution.cpp:21
double laplace(double s)
computing the Laplace transform of the distribution at real point
Definition: exponentialDistribution.cpp:79
double _mean
Definition: Distribution.h:239
double rate()
Read accessor for the rate.
Definition: exponentialDistribution.h:33
void write(FILE *out, int mode)
Definition: exponentialDistribution.cpp:135
double dLaplace(double s)
computing the derivative of the Laplace transform at real points
Definition: exponentialDistribution.cpp:95