#include <shark/Rng/Cauchy.h>
Public Member Functions | |
Cauchy (RngType &rng, double median=0, double sigma=1) | |
Creates a new Cauchy random generator instance. More... | |
double | operator() (double median, double sigma) |
creates a cauchy distributed number from parameters More... | |
double | median () const |
returns the current median of the distribution More... | |
double | sigma () const |
returns the width of the distribution More... | |
void | median (double newMedian) |
void | sigma (double newSigma) |
double | p (double x) const |
Cauchy distribution.
This class is a thin wrapper for the boost::cauchy_distribution class. The Cauchy distribution (aka "Lorentzian") is defined by:
\( f(x) = \frac{1}{\pi \sigma (1 + \left[\frac {(x-x_0)} \sigma\right]^2 )} \)
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.
|
inline |
|
inline |
returns the current median of the distribution
Definition at line 98 of file Cauchy.h.
Referenced by shark::Cauchy< RngType >::p(), and shark::Cauchy< RngType >::sigma().
|
inline |
sets the median of the distribution
newMedian | the new value for the Median |
Definition at line 110 of file Cauchy.h.
References shark::Cauchy< RngType >::sigma().
|
inline |
|
inline |
Returns the probability for the occurrence of random number "x".
x | the point for which to calculate the propability |
Definition at line 122 of file Cauchy.h.
References shark::entropy(), shark::Cauchy< RngType >::median(), shark::Cauchy< RngType >::sigma(), and shark::sqr().
|
inline |
returns the width of the distribution
Definition at line 104 of file Cauchy.h.
Referenced by shark::Cauchy< RngType >::median(), and shark::Cauchy< RngType >::p().
|
inline |
sets the width of the distribution
newSigma | the new value for sigma |
Definition at line 116 of file Cauchy.h.
References shark::Cauchy< RngType >::median().