Cauchy Class Reference

This class simulates a "standard %Cauchy distribution". More...

#include <Cauchy.h>

Inheritance diagram for Cauchy:
RandomVar< double >

List of all members.

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".

Detailed Description

This class simulates a "standard %Cauchy distribution".

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:

$ f(x) = \frac{1}{\pi (1 + x^2)} $

Below you can see the distribution:

cauchy.png


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.

Author:
M. Kreutz
Date:
1998-08-17
Changes:
none
Status:
stable

Definition at line 89 of file Cauchy.h.


Constructor & Destructor Documentation

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.

Returns:
none
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 113 of file Cauchy.h.

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.

Parameters:
r the pseudo random number generator that is used
Returns:
none
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 143 of file Cauchy.h.


Member Function Documentation

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.

Returns:
a Cauchy random number
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Implements RandomVar< double >.

Definition at line 74 of file Cauchy.cpp.

References RandomVar< double >::rng.

double Cauchy::p ( const double &  x  )  const [virtual]

Returns the probability for the occurrence of random number "x".

Parameters:
x the random number for which the occurrence probability is returned
Returns:
the probability for the occurrence of random number x
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Implements RandomVar< double >.

Definition at line 106 of file Cauchy.cpp.


The documentation for this class was generated from the following files: