Shark Machine Learning Library

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

`#include <Cauchy.h>`

Inheritance diagram for Cauchy:

## 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 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:

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.

**Date:**- 1998-08-17

**Changes:**- none

**Status:**- stable

Definition at line 89 of file Cauchy.h.

Cauchy::Cauchy | ( | ) | ` [inline]` |

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

**Date:**- 1995-01-01

**Changes**- none

**Status**- stable

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

**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*

**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: