Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
BernoulliDistribution.h
1 #ifndef BERNOULLIDISTRIBUTION_H
2 #define BERNOULLIDISTRIBUTION_H
3 
4 // The general discrete distribution with finite support
5 
6 #include "discreteDistribution.h"
7 
13 
14  public:
20  BernoulliDistribution( double ); // creation from a value
21 
22  private:
23  double _proba; // proba of the value 1 /**< TODO */
24 
25  public: // accessors
31  double getParameter() { return _proba; }
32 
33  public: // probabilistic member functions
39  double mean();
45  double rate(); // inverse of the mean
52  double moment( int n );
58  double variance();
65  double laplace( double s ); // Laplace transform at real points
72  double dLaplace( double s ); // derivative of the Laplace transform
79  double cdf( double x );
86  bool hasMoment( int n );
87 
94  BernoulliDistribution *rescale( double factor );
101 
107  double sample();
114  void iidSample( int n, double* s );
115 
116  public:
122  std::string toString();
129  void write( FILE *out, int mode );
130 
131 };
132 
133 #endif // BERNOULLIDISTRIBUTION_H