Generates a pseudorandom number from a Cauchy distribution.
A double which specifies a pseudorandom number from a Cauchy distribution.
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
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.
Random Class | Imsl.Stat Namespace | Example