#include <Cauchy.h>
Public Member Functions | |
Cauchy () | |
Creates a new Cauchy random generator instance. | |
Cauchy (RNG &r) | |
Creates a new Cauchy random generator instance by using the pseudo random number generator "r" for the determination of random values. | |
double | operator() () |
Returns a Cauchy random number. | |
double | p (const double &) const |
Returns the probability for the occurrence of random number "x". |
This class is derived from class RandomVar and the uniformally distributed pseudo random number values of the interval (0,1) are transformed to type "double" of distribution Cauchy.
The Cauchy distribution (aka "Lorentzian") is defined by:
Below you can see the distribution:
The Cauchy distribution is important as an example of a pathological case. The Cauchy distribution looks similar to a Normal distribution, but has much heavier tails. When studying hypothesis tests that assume normality, seeing how the tests perform on data from a Cauchy distribution is a good indicator of how sensitive the tests are to heavy-tail departures from normality. Likewise, it is a good check for robust techniques that are designed to work well under a wide variety of distributional assumptions.
Cauchy::Cauchy | ( | ) | [inline] |
Creates a new Cauchy random generator instance.
For this instance, the default pseudo random number generator as member of class RandomVar is used.
Cauchy::Cauchy | ( | RNG & | r | ) | [inline] |
Creates a new Cauchy random generator instance by using the pseudo random number generator "r" for the determination of random values.
Each instance of a Cauchy random number generator is based on a generator, that is defined in class RNG and returns uniformally pseudo random numbers of the interval (0,1). By default, this is a global generator named RNG::globalRng and included as member in class RandomVar.
Here another pseudo random number generator r is used instead.
r | the pseudo random number generator that is used |
double Cauchy::operator() | ( | ) | [virtual] |
Returns a Cauchy random number.
This method performs the inverse transformation of the original uniformally distributed random numbers of the interval (0,1) created by the used pseudo random number generator to the type of the Cauchy distribution.
Therefore a method based on "Numerical Recipes in C, p. 220" is used.
Implements RandomVar< double >.
double Cauchy::p | ( | const double & | x | ) | const [virtual] |
Returns the probability for the occurrence of random number "x".
Returns the probability for the occurrence of random number "x".
x | the random number for which the occurrence probability is returned |
Implements RandomVar< double >.