Namespace:
Imsl.Stat
Assembly:
ImslCS (in ImslCS.dll) Version: 6.5.0.0
Syntax
C# |
---|
public virtual double NextCauchy() |
Visual Basic (Declaration) |
---|
Public Overridable Function NextCauchy As Double |
Visual C++ |
---|
public: virtual double NextCauchy() |
Return Value
A double which specifies a pseudorandom number from a Cauchy distribution.
Remarks

Use of the inverse CDF technique would yield a Cauchy deviate from a
uniform (0, 1) deviate, u, as . Rather than evaluating a
tangent directly, however, NextCauchy generates two uniform
(-1, 1) deviates,
and
. These values can be thought of as sine and
cosine values. If

is less than or equal to 1, then is
delivered as the Cauchy deviate; otherwise,
and
are rejected and two new uniform (-1, 1)
deviates are generated. This method is also equivalent to taking the
ratio of two independent normal deviates.
Deviates from the Cauchy distribution with median t and first quartile t - s, that is, with density
![f\left( x \right) = \frac{s}{{\pi \left[
{s^2 + \left( {x - t} \right)^2 } \right]}}](eqn/eqn_3377.png)
can be obtained by scaling the output from NextCauchy. To do this, first scale the output from NextCauchy by S and then add T to the result.