Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
diracDistribution.h
1 #ifndef diracDistribution_H
2 #define diracDistribution_H
3 
4 #include "discreteDistribution.h"
5 
11 class diracDistribution : public virtual discreteDistribution {
12 
13 public:
19  diracDistribution( double val ); // creation from a value
20 
21 private:
22  // specific variables
23  double _value;
25 public:
26  // accessors to specific variables
32  double value(int) { return _value; };
33 
34 public:
35  // probabilistic member functions
39  double mean();
43  double rate();
47  double moment( int order );
52  double variance();
56  double laplace( double s ); // Laplace transform at real points
60  double dLaplace( double s ); // derivative of the Laplace transform
64  double cdf( double x );
68  bool hasMoment( int order );
69 
73  diracDistribution *rescale( double factor );
78 
82  double sample();
89  void iidSample( int n, double* s );
90 
91  public:
95  std::string toString();
99  void write( FILE *out, int mode );
100 
101 };
102 
103 #endif // diracDistribution_H
double dLaplace(double s)
computing the derivative of the Laplace transform at real points
Definition: diracDistribution.cpp:123
diracDistribution * copy()
copying a distribution. Typically implemented as rescale(1.0).
Definition: diracDistribution.cpp:195
double variance()
Variance of the Dirac distribution. Reimplemented to return always 0.
Definition: diracDistribution.cpp:87
double sample()
drawing a (pseudo)random value according to the distribution.
Definition: diracDistribution.cpp:203
void iidSample(int n, double *s)
Sampling of i.i.d. values in a table. Reimplemented in order to avoid useless function calls...
Definition: diracDistribution.cpp:210
diracDistribution * rescale(double factor)
rescaling a distribution by some real factor. Not all distributions allow this for any real factor...
Definition: diracDistribution.cpp:185
double moment(int order)
Computing the moments of the distribution.
Definition: diracDistribution.cpp:78
The Dirac distribution concentrated at some point.
Definition: diracDistribution.h:26
diracDistribution(double val)
Unique constructor for the Dirac distribution from its value.
Definition: diracDistribution.cpp:27
double cdf(double x)
computing the cumulative distribution function at some real point x. This is the probability that the...
Definition: diracDistribution.cpp:137
std::string toString()
an utility to convert the distribution into a string.
Definition: diracDistribution.cpp:173
double rate()
computing the "rate", defined as the inverse of the mean
Definition: diracDistribution.cpp:62
bool hasMoment(int order)
test for the existence of moments of any order
Definition: diracDistribution.cpp:98
double laplace(double s)
computing the Laplace transform of the distribution at real point
Definition: diracDistribution.cpp:109
double mean()
computing the mathematical expectation or mean
Definition: diracDistribution.cpp:50
double value(int)
Read accessor to the value of the Dirac distribution.
Definition: diracDistribution.h:32
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25
void write(FILE *out, int mode)
an utility to write the distribution to some file, according to some format.
Definition: diracDistribution.cpp:158