STK++ 0.9.13
|
Cauchy distribution law. More...
#include <STK_Law_Cauchy.h>
Public Types | |
typedef IUnivLaw< Real > | Base |
Public Member Functions | |
Cauchy (Real const &mu=0, Real const &scale=1) | |
Default constructor. | |
virtual | ~Cauchy () |
Destructor. | |
Real const & | mu () const |
Real const & | scale () const |
void | setMu (Real const &mu) |
void | setScale (Real const &scale) |
virtual Real | rand () const |
Generate a pseudo Cauchy random variate. | |
virtual Real | pdf (Real const &x) const |
virtual Real | lpdf (Real const &x) const |
virtual Real | cdf (Real const &t) const |
The cumulative distribution function of the Cauchy distribution at t is. | |
virtual Real | icdf (Real const &p) const |
The inverse cumulative distribution function at p 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 &mu, Real const &scale) |
Generate a pseudo Cauchy random variate with the specified parameters. | |
static Real | pdf (Real const &x, Real const &mu, Real const &scale) |
static Real | lpdf (Real const &x, Real const &mu, Real const &scale) |
static Real | cdf (Real const &t, Real const &mu, Real const &scale) |
The cumulative distribution function of the Cauchy distribution at t is. | |
static Real | icdf (Real const &p, Real const &mu, Real const &scale) |
The inverse cumulative distribution function at p is. | |
Protected Attributes | |
Real | mu_ |
The mu parameter. | |
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. | |
Cauchy distribution law.
The Cauchy distribution, named after Augustin Cauchy, is a continuous probability distribution. The Cauchy distribution has the probability density function
where
The simplest Cauchy distribution is called the standard Cauchy distribution. It is the distribution of a random variable that is the ratio of two independent standard normal variables and has the probability density function
Definition at line 65 of file STK_Law_Cauchy.h.
Definition at line 68 of file STK_Law_Cauchy.h.
Default constructor.
mu,scale | location and scale of the Cauchy distribution |
Definition at line 72 of file STK_Law_Cauchy.h.
References Cauchy(), mu(), scale(), and STKDOMAIN_ERROR_2ARG.
|
inlinevirtual |
The cumulative distribution function of the Cauchy distribution at t is.
t | a real value |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 131 of file STK_Law_Cauchy.cpp.
References STK::isNA(), mu_, STK::Arithmetic< Type >::NA(), and scale_.
The cumulative distribution function of the Cauchy distribution at t is.
t | a real value |
mu,scale | location and scale of the Cauchy distribution |
Definition at line 174 of file STK_Law_Cauchy.cpp.
References STK::isNA(), mu(), STK::Arithmetic< Type >::NA(), and scale().
The inverse cumulative distribution function at p is.
p | a probability number |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 156 of file STK_Law_Cauchy.cpp.
References icdf(), STK::isNA(), mu_, STK::Arithmetic< Type >::NA(), scale_, and STKDOMAIN_ERROR_1ARG.
The inverse cumulative distribution function at p is.
p | a probability number |
mu,scale | location and scale of the Cauchy distribution |
Definition at line 199 of file STK_Law_Cauchy.cpp.
References icdf(), STK::isNA(), mu(), STK::Arithmetic< Type >::NA(), scale(), and STKDOMAIN_ERROR_1ARG.
x | a real value |
Reimplemented from STK::Law::IUnivLaw< Real >.
Definition at line 98 of file STK_Law_Cauchy.cpp.
References STK::isNA(), mu_, STK::Arithmetic< Type >::NA(), and scale_.
Referenced by lpdf().
Definition at line 111 of file STK_Law_Cauchy.cpp.
References STK::isNA(), lpdf(), mu(), STK::Arithmetic< Type >::NA(), scale(), and STKDOMAIN_ERROR_2ARG.
x | a real value |
Implements STK::Law::IUnivLaw< Real >.
Definition at line 67 of file STK_Law_Cauchy.cpp.
References STK::isNA(), mu_, STK::Arithmetic< Type >::NA(), and scale_.
Referenced by pdf().
x | a real value |
mu,scale | location and scale of the Cauchy distribution |
Definition at line 80 of file STK_Law_Cauchy.cpp.
References STK::isNA(), mu(), STK::Arithmetic< Type >::NA(), pdf(), scale(), and STKDOMAIN_ERROR_2ARG.
|
virtual |
Generate a pseudo Cauchy random variate.
Implements STK::Law::IUnivLaw< Real >.
Definition at line 49 of file STK_Law_Cauchy.cpp.
Generate a pseudo Cauchy random variate with the specified parameters.
mu,scale | location and scale of the Cauchy distribution |
Definition at line 56 of file STK_Law_Cauchy.cpp.
References Cauchy(), mu(), scale(), and STKDOMAIN_ERROR_2ARG.
scale | the scale parameter |
Definition at line 91 of file STK_Law_Cauchy.h.
References scale(), scale_, setScale(), and STKRUNTIME_ERROR_1ARG.
Referenced by setScale().
|
protected |
|
protected |
The scale parameter.
Definition at line 183 of file STK_Law_Cauchy.h.
Referenced by cdf(), icdf(), lpdf(), pdf(), rand(), scale(), and setScale().