Java Code Examples for org.apache.commons.math3.distribution.IntegerDistribution#inverseCumulativeProbability()

The following examples show how to use org.apache.commons.math3.distribution.IntegerDistribution#inverseCumulativeProbability() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @throws MathIllegalArgumentException if the underlynig distribution throws one
 * @since 2.2
 * @deprecated use the distribution's sample() method
 */
@Deprecated
public int nextInversionDeviate(IntegerDistribution distribution)
    throws MathIllegalArgumentException {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 2
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @throws MathIllegalArgumentException if the underlynig distribution throws one 
 * @since 2.2
 * @deprecated use the distribution's sample() method
 */
public int nextInversionDeviate(IntegerDistribution distribution)
    throws MathIllegalArgumentException {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 3
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @since 2.2
 */
public int nextInversionDeviate(IntegerDistribution distribution) {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 4
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @throws MathIllegalArgumentException if the underlynig distribution throws one
 * @since 2.2
 * @deprecated use the distribution's sample() method
 */
@Deprecated
public int nextInversionDeviate(IntegerDistribution distribution)
    throws MathIllegalArgumentException {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 5
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @since 2.2
 */
public int nextInversionDeviate(IntegerDistribution distribution) {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 6
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @throws MathIllegalArgumentException if the underlynig distribution throws one
 * @since 2.2
 * @deprecated use the distribution's sample() method
 */
public int nextInversionDeviate(IntegerDistribution distribution)
    throws MathIllegalArgumentException {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 7
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @throws MathIllegalArgumentException if the underlynig distribution throws one
 * @since 2.2
 * @deprecated use the distribution's sample() method
 */
@Deprecated
public int nextInversionDeviate(IntegerDistribution distribution)
    throws MathIllegalArgumentException {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}
 
Example 8
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Generate a random deviate from the given distribution using the
 * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> inversion method.</a>
 *
 * @param distribution Integer distribution to generate a random value from
 * @return a random value sampled from the given distribution
 * @throws MathIllegalArgumentException if the underlynig distribution throws one
 * @since 2.2
 * @deprecated use the distribution's sample() method
 */
@Deprecated
public int nextInversionDeviate(IntegerDistribution distribution)
    throws MathIllegalArgumentException {
    return distribution.inverseCumulativeProbability(nextUniform(0, 1));
}