Updated: 31 March 2014
Use the table-valued function RANDCAUCHY to generate a sequence of random numbers from a Cauchy distribution with locations @mu and scale @sig.
SELECT * FROM [wctMath].[wct].[RANDCAUCHY](
the number of rows to generate. @Rows must be of the type int or of a type that implicitly converts to int.
the location parameter. @mu must be of the type float or of a type that implicitly converts to float.
the scale parameter. @sig must be of the type float or of a type that implicitly converts to float.
RETURNS TABLE (
[Seq] [int] NULL,
[X] [float] NULL
· @sig must be greater than zero.
· If @mu is NULL then @mu is set to 0.
· If @sig is NULL then @sig is set to 1.
· If @Rows is less than 1 then no rows are returned.
In this example we create a sequence 1,000,000 random numbers rounded to one decimal place from a Cauchy distribution with @mu = 0 and @sig = 1, COUNT the results, paste them into Excel where the values are between -10 and 10 and graph them.
COUNT(*) as COUNT
ROUND(X,1) as X
X BETWEEN -10 AND 10
This produces the following result.