STK++ 0.9.13
|
class for the Uniform law distribution. More...
#include <STK_Law_Uniform.h>
Public Types | |
typedef IUnivLaw< Real > | Base |
Public Member Functions | |
Uniform (Real const &a=0., Real const &b=1.) | |
constructor. | |
Uniform (Uniform const &law) | |
copy constructor. | |
virtual | ~Uniform () |
destructor. | |
Real const & | a () const |
Real const & | b () const |
Real const & | range () const |
void | setA (Real const &a) |
void | setB (Real const &b) |
virtual Real | rand () const |
Generate a pseudo Uniform 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 &a, Real const &b) |
Generate a pseudo Uniform random variate. | |
static Real | pdf (Real const &x, Real const &a, Real const &b) |
Give the value of the pdf at x. | |
static Real | lpdf (Real const &p, Real const &a, Real const &b) |
Give the value of the log-pdf at x. | |
static Real | cdf (Real const &t, Real const &a, Real const &b) |
Give the value of the cdf at t. | |
static Real | icdf (Real const &p, Real const &a, Real const &b) |
Give the value of the quantile at p. | |
Protected Attributes | |
Real | a_ |
The lower bound. | |
Real | b_ |
The upper bound. | |
![]() | |
String | name_ |
Name of the Law. | |
Private Attributes | |
Real | range_ |
Additional Inherited Members | |
![]() | |
IUnivLaw (String const &name) | |
Constructor. | |
IUnivLaw (IUnivLaw const &law) | |
copy Constructor. | |
![]() | |
ILawBase (String const &name) | |
Constructor. | |
~ILawBase () | |
destructor. | |
class for the Uniform law distribution.
In probability theory and statistics, the continuous uniform distribution or rectangular distribution is a family of symmetric probability distributions such that for each member of the family, all intervals of the same length on the distribution's support are equally probable. The support is defined by the two parameters, a and b, which are its minimum and maximum values.
The probability density function of the continuous uniform distribution is:
Definition at line 59 of file STK_Law_Uniform.h.
Definition at line 62 of file STK_Law_Uniform.h.
constructor.
a,b | the lower and upper bounds |
Definition at line 66 of file STK_Law_Uniform.h.
References a_, b_, range_, STKINVALIDARGUMENT_ERROR_2ARG, and Uniform().
Referenced by Uniform().
|
inlinevirtual |
The cumulative distribution function is.
t | a real value |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 78 of file STK_Law_Uniform.cpp.
The inverse cumulative distribution function is.
p | a probability |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 92 of file STK_Law_Uniform.cpp.
References a_, b_, STK::Law::Exponential::icdf(), range_, and STKDOMAIN_ERROR_1ARG.
Give the value of the log-pdf at x.
p | a probablility |
a,b | the lower and upper bounds |
Definition at line 127 of file STK_Law_Uniform.cpp.
Give the value of the log-pdf at x.
x | a real value |
Reimplemented from STK::Law::IUnivLaw< Real >.
Definition at line 66 of file STK_Law_Uniform.cpp.
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_Uniform.cpp.
Give the value of the pdf at x.
x | a real value |
a,b | the lower and upper bounds |
Definition at line 117 of file STK_Law_Uniform.cpp.
|
virtual |
Generate a pseudo Uniform random variate.
a,b | the lower and upper bounds |
Definition at line 108 of file STK_Law_Uniform.cpp.
|
protected |
|
protected |
|
private |