Example usage for org.apache.commons.math.random RandomDataImpl nextCauchy

List of usage examples for org.apache.commons.math.random RandomDataImpl nextCauchy

Introduction

In this page you can find the example usage for org.apache.commons.math.random RandomDataImpl nextCauchy.

Prototype

public double nextCauchy(double median, double scale) throws MathException 

Source Link

Document

Generates a random value from the CauchyDistributionImpl Cauchy Distribution .

Usage

From source file:datafu.pig.hash.lsh.p_stable.L1LSH.java

/**
 * Draw a sample s ~ Cauchy(0,1), which is 1-stable.
 * //from   ww  w.  j a  v a2  s.  co  m
 * @return a sample from a cauchy distribution with median 0 and scale 1
 */
public double sample(RandomDataImpl randomData) throws MathException {

    return randomData.nextCauchy(0, 1);

}