Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Functions Variables
geometricDistribution.h
1 /* Marmote is free software: you can redistribute it and/or modify
2 it under the terms of the GNU General Public License as published by
3 the Free Software Foundation, either version 3 of the License, or
4 (at your option) any later version.
5 
6 Marmote is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 GNU General Public License for more details.
10 
11 You should have received a copy of the GNU General Public License
12 along with Marmote. If not, see <http://www.gnu.org/licenses/>.
13 
14 Copyright 2015 Alain Jean-Marie, Jean-Michel Fourneau, Jean-Marc Vincent, Issam Rabhi */
15 
16 #ifndef geometricDistribution_H
17 #define geometricDistribution_
18 
19 #include "Distribution.h"
20 
27 class geometricDistribution : public virtual Distribution {
28 
29 public:
30  // constructors
36  geometricDistribution( double p );
37 
38 private:
39  // specific variables
40  double _p;
42 public:
43  // accessors
50  double getProba( int k );
57  double p() { return _p; }
64  double getRatio() { return _p; }
65 
66 public:
67  // probabilistic member functions
73  double mean();
79  double rate(); // inverse of the mean
83  double moment( int order );
87  double laplace( double s ); // Laplace transform at real points
91  double dLaplace( double s ); // derivative of the Laplace transform
98  double cdf( double x );
105  bool hasMoment( int order );
106 
113  geometricDistribution *rescale( double factor );
118 
126  double sample();
127 
128  public:
134  std::string toString();
141  void write( FILE *out, int mode );
142 
143 };
144 
145 #endif // geometricDistribution_H