Cauchy distribution C(a, b) with shift parameter a and scale parameter b > 0 is described by probability density function:

To model random values, the function uses method of inverse transformation, which enables the user to get target sample from a standard continuous uniform distribution using inverse function of the Cauchy distribution, if the sample generator is available:
![]()
The following steps are executed to generate a pseudo-random value X ~ C(a, b):
Generate a sample u1, …, un of pseudo-random values based on a standard continuous uniform distribution at the interval (0, 1).
Based on the
inverse function, calculate sample of the specified Cauchy distribution:
![]()
See also: