STK++ 0.9.13
|
Exponential distribution law. More...
#include <STK_Law_Exponential.h>
Public Types | |
typedef IUnivLaw< Real > | Base |
Public Member Functions | |
Exponential (Real const &scale=1) | |
constructor. | |
virtual | ~Exponential () |
destructor. | |
virtual Real | rand () const |
Generate a pseudo Exponential random variate. | |
virtual Real | pdf (Real const &x) const |
Give the value of the pdf at x. | |
virtual Real | lpdf (Real const &x) const |
Give the value of the log-pdf at x. | |
virtual Real | cdf (Real const &t) const |
The cumulative distribution function is. | |
virtual Real | icdf (Real const &p) const |
The inverse cumulative distribution function is. | |
![]() | |
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. | |
![]() | |
String const & | name () const |
Static Public Member Functions | |
static Real | rand (Real const &scale) |
Generate a pseudo Exponential random variate with the specified parameter. | |
static Real | pdf (Real const &x, Real const &scale) |
Give the value of the pdf at x. | |
static Real | lpdf (Real const &x, Real const &scale) |
Give the value of the log-pdf at x. | |
static Real | cdf (Real const &t, Real const &scale) |
Compute he cumulative distribution function. | |
static Real | icdf (Real const &p, Real const &scale) |
Compute rhe inverse cumulative distribution function. | |
Protected Attributes | |
Real | scale_ |
The scale parameter. | |
![]() | |
String | name_ |
Name of the Law. | |
Additional Inherited Members | |
![]() | |
IUnivLaw (String const &name) | |
Constructor. | |
IUnivLaw (IUnivLaw const &law) | |
copy Constructor. | |
![]() | |
ILawBase (String const &name) | |
Constructor. | |
~ILawBase () | |
destructor. | |
Exponential distribution law.
In probability theory and statistics, the exponential distribution (a.k.a. negative exponential distribution) is the probability distribution that describes the time between events in a Poisson process, i.e. a process in which events occur continuously and independently at a constant average rate. It is a particular case of gamma distribution. It is the continuous analogue of the geometric distribution, and it has the key property of being memoryless. In addition to being used for the analysis of Poisson processes, it is found in various other contexts.
The probability density function (pdf) of an exponential distribution is
where
Definition at line 63 of file STK_Law_Exponential.h.
Definition at line 66 of file STK_Law_Exponential.h.
constructor.
Definition at line 68 of file STK_Law_Exponential.h.
References Exponential(), and STKDOMAIN_ERROR_1ARG.
Referenced by Exponential().
|
inlinevirtual |
The cumulative distribution function is.
t | a real value |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 85 of file STK_Law_Exponential.cpp.
References STK::isNA(), STK::Arithmetic< Type >::NA(), and scale_.
Compute he cumulative distribution function.
t | a real value |
scale | the scale of the distribution |
Definition at line 157 of file STK_Law_Exponential.cpp.
References STK::isNA(), and STK::Arithmetic< Type >::NA().
The inverse cumulative distribution function is.
p | a probability |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 99 of file STK_Law_Exponential.cpp.
References icdf(), STK::isNA(), STK::Arithmetic< Type >::NA(), scale_, and STKDOMAIN_ERROR_1ARG.
Referenced by icdf(), STK::Law::Uniform::icdf(), STK::Law::UniformDiscrete::icdf(), and icdf().
Compute rhe inverse cumulative distribution function.
p | a probability |
scale | the scale of the distribution |
Definition at line 172 of file STK_Law_Exponential.cpp.
References icdf(), STK::isNA(), STK::Arithmetic< Type >::NA(), and STKDOMAIN_ERROR_1ARG.
Give the value of the log-pdf at x.
x | a real value |
Reimplemented from STK::Law::IUnivLaw< Real >.
Definition at line 71 of file STK_Law_Exponential.cpp.
References STK::isNA(), STK::Arithmetic< Type >::NA(), and scale_.
Give the value of the log-pdf at x.
x | a real value |
scale | the scale of the distribution |
Definition at line 142 of file STK_Law_Exponential.cpp.
References STK::isNA(), and STK::Arithmetic< Type >::NA().
Give the value of the pdf at x.
x | a real value |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 57 of file STK_Law_Exponential.cpp.
References STK::isNA(), STK::Arithmetic< Type >::NA(), and scale_.
Give the value of the pdf at x.
x | a real value |
scale | the scale of the distribution |
Definition at line 128 of file STK_Law_Exponential.cpp.
References STK::isNA(), and STK::Arithmetic< Type >::NA().
|
virtual |
Generate a pseudo Exponential random variate.
Implements STK::Law::IUnivLaw< Real >.
Definition at line 51 of file STK_Law_Exponential.cpp.
References scale_.
Referenced by rand(), STK::Law::Gamma::rand(), STK::Gamma_a_bjk< Array >::randomInit(), STK::Gamma_a_bk< Array >::randomInit(), STK::Gamma_aj_bjk< Array >::randomInit(), STK::Gamma_aj_bk< Array >::randomInit(), STK::Gamma_ajk_b< Array >::randomInit(), STK::Gamma_ajk_bj< Array >::randomInit(), STK::Gamma_ajk_bjk< Array >::randomInit(), STK::Gamma_ajk_bk< Array >::randomInit(), STK::Gamma_ak_b< Array >::randomInit(), STK::Gamma_ak_bj< Array >::randomInit(), STK::Gamma_ak_bjk< Array >::randomInit(), STK::Gamma_ak_bk< Array >::randomInit(), STK::HDMatrixGaussianModel< IdRow_, IdCol_, Array_ >::randomInit(), STK::Poisson_ljk< Array >::randomInit(), STK::Poisson_ljlk< Array >::randomInit(), and STK::Poisson_lk< Array >::randomInit().
Generate a pseudo Exponential random variate with the specified parameter.
scale | the scale of the distribution |
Definition at line 117 of file STK_Law_Exponential.cpp.
References rand(), and STKDOMAIN_ERROR_1ARG.
|
protected |