| STK++ 0.9.13
    | 
Geometric probability law. More...
#include <STK_Law_Geometric.h>

| Public Types | |
| typedef IUnivLaw< Integer > | Base | 
| Public Member Functions | |
| Geometric (Real const &prob=0.5) | |
| constructor | |
| virtual | ~Geometric () | 
| destructor | |
| Real const & | prob () const | 
| void | setProb (Real const &prob) | 
| virtual Integer | rand () const | 
| virtual Real | pdf (Integer const &x) const | 
| compute the probability distribution function (density) Give the value of the pdf at the point x. | |
| virtual Real | lpdf (Integer const &x) const | 
| compute the log probability distribution function Give the value of the log-pdf at the point x. | |
| virtual Real | cdf (Real const &t) const | 
| compute the cumulative distribution function Give the probability that a Geometric random variate is less or equal to t. | |
| virtual Integer | icdf (Real const &p) const | 
| inverse cumulative distribution function The quantile is defined as the smallest value x such that  F(x) >= p , where F is the cumulative distribution function. | |
|  Public Member Functions inherited from STK::Law::IUnivLaw< Integer > | |
| virtual | ~IUnivLaw () | 
| Virtual destructor. | |
| virtual Real | lcdf (Real const &t) const | 
| compute the lower tail log-cumulative distribution function Give the log-probability that a random variate is less or equal to t. | |
| virtual Real | cdfc (Real const &t) const | 
| calculate the complement of cumulative distribution function, called in statistics the survival function. | |
| virtual Real | lcdfc (Real const &t) const | 
| calculate the log-complement of cumulative distribution function Give the log-probability that a random variate is greater than t. | |
|  Public Member Functions inherited from STK::Law::ILawBase | |
| String const & | name () const | 
| Static Public Member Functions | |
| static Integer | rand (Real const &prob) | 
| static Real | pdf (Integer x, Real const &prob) | 
| compute the probability distribution function (density) Give the value of the pdf at the point x. | |
| static Real | lpdf (Integer x, Real const &prob) | 
| compute the log probability distribution function Give the value of the log-pdf at the point x. | |
| static Real | cdf (Real const &t, Real const &prob) | 
| compute the cumulative distribution function Give the probability that a Geometric random variate is less or equal to t. | |
| static Integer | icdf (Real const &p, Real const &prob) | 
| inverse cumulative distribution function The quantile is defined as the smallest value x such that  F(x) >= p , where F is the cumulative distribution function. | |
| Protected Attributes | |
| Real | prob_ | 
| probability of success in a Bernoulli trial | |
|  Protected Attributes inherited from STK::Law::ILawBase | |
| String | name_ | 
| Name of the Law. | |
| Additional Inherited Members | |
|  Protected Member Functions inherited from STK::Law::IUnivLaw< Integer > | |
| IUnivLaw (String const &name) | |
| Constructor. | |
| IUnivLaw (IUnivLaw const &law) | |
| copy Constructor. | |
|  Protected Member Functions inherited from STK::Law::ILawBase | |
| ILawBase (String const &name) | |
| Constructor. | |
| ~ILawBase () | |
| destructor. | |
Geometric probability law.
In probability theory and statistics, the Geometric distribution with parameter p is the discrete probability distribution of the number of failures of Bernoulli trials before the first success.
In general, if the random variable X follows the geometric distribution with parameters p, we write 
![\[ f(k;p) = \mathbb{P}(X = k) = p(1-p)^{k} \mbox{ for } k=0,1,\ldots \]](form_238.png)
Definition at line 58 of file STK_Law_Geometric.h.
Definition at line 61 of file STK_Law_Geometric.h.
constructor
| prob | probability of success in a Bernoulli trial | 
Definition at line 65 of file STK_Law_Geometric.h.
| 
 | inlinevirtual | 
compute the cumulative distribution function Give the probability that a Geometric random variate is less or equal to t.
| t | a real value | 
Implements STK::Law::IUnivLaw< Integer >.
Definition at line 77 of file STK_Law_Geometric.cpp.
compute the cumulative distribution function Give the probability that a Geometric random variate is less or equal to t.
| t | a real value | 
| prob | the probability of success in a Bernoulli trial | 
Definition at line 124 of file STK_Law_Geometric.cpp.
inverse cumulative distribution function The quantile is defined as the smallest value x such that F(x) >= p , where F is the cumulative distribution function.
| p | a probability number | 
Implements STK::Law::IUnivLaw< Integer >.
Definition at line 86 of file STK_Law_Geometric.cpp.
inverse cumulative distribution function The quantile is defined as the smallest value x such that F(x) >= p , where F is the cumulative distribution function.
| p | a probability number | 
| prob | the probability of success in a Bernoulli trial | 
Definition at line 133 of file STK_Law_Geometric.cpp.
compute the log probability distribution function Give the value of the log-pdf at the point x.
| x | a binary value | 
Reimplemented from STK::Law::IUnivLaw< Integer >.
Definition at line 67 of file STK_Law_Geometric.cpp.
compute the log probability distribution function Give the value of the log-pdf at the point x.
| x | a binary value | 
| prob | the probability of success in a Bernoulli trial | 
Definition at line 114 of file STK_Law_Geometric.cpp.
compute the probability distribution function (density) Give the value of the pdf at the point x.
| x | a binary value | 
Implements STK::Law::IUnivLaw< Integer >.
Definition at line 58 of file STK_Law_Geometric.cpp.
compute the probability distribution function (density) Give the value of the pdf at the point x.
| x | a binary value | 
| prob | the probability of success in a Bernoulli trial | 
Definition at line 104 of file STK_Law_Geometric.cpp.
Definition at line 70 of file STK_Law_Geometric.h.
References prob_.
Referenced by setProb().
| 
 | virtual | 
Implements STK::Law::IUnivLaw< Integer >.
Definition at line 49 of file STK_Law_Geometric.cpp.
| prob | the probability of success in a Bernoulli trial | 
Definition at line 94 of file STK_Law_Geometric.cpp.
| prob | the probability of success to set | 
Definition at line 72 of file STK_Law_Geometric.h.
References prob(), prob_, setProb(), and STKDOMAIN_ERROR_1ARG.
Referenced by setProb().
| 
 | protected | 
probability of success in a Bernoulli trial
Definition at line 152 of file STK_Law_Geometric.h.