## org.apache.mahout.math.jet.random
Class EmpiricalWalker

    java.lang.Object
      org.apache.mahout.math.PersistentObject
          org.apache.mahout.math.jet.random.AbstractDistribution
              org.apache.mahout.math.jet.random.AbstractDiscreteDistribution
                  org.apache.mahout.math.jet.random.EmpiricalWalker

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, org.apache.mahout.math.function.DoubleFunction, IntFunction, UnaryFunction

Deprecated. until unit tests are in place. Until this time, this class/interface is unsupported.

    @Deprecated
    public final class EmpiricalWalker

extends AbstractDiscreteDistribution

See Also:
  Serialized Form

Field Summary

Fields inherited from class org.apache.mahout.math.jet.random.AbstractDistribution
`randomGenerator`

Constructor Summary
`EmpiricalWalker(double[] pdf, int interpolationType, java.util.Random randomGenerator)` Deprecated. Constructs an Empirical distribution.

Method Summary
`double` `cdf(int k)` Deprecated. Returns the cumulative distribution function.
`java.lang.Object` `clone()` Deprecated. Returns a deep copy of the receiver; the copy will produce identical sequences.
`int` `nextInt()` Deprecated. Returns a random integer `k` with probability `pdf(k)`.
`double` `pdf(int k)` Deprecated. Returns the probability distribution function.
`void` `setState(double[] pdf, int interpolationType)` Deprecated. Sets the distribution parameters.
`void` `setState2(double[] pdf)` Deprecated. Sets the distribution parameters.
`java.lang.String` `toString()` Deprecated. Returns a String representation of the receiver.

Methods inherited from class org.apache.mahout.math.jet.random.AbstractDiscreteDistribution
`nextDouble`

Methods inherited from class org.apache.mahout.math.jet.random.AbstractDistribution
`apply, apply, getRandomGenerator, setRandomGenerator`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### EmpiricalWalker

    public EmpiricalWalker(double[] pdf,
                           int interpolationType,
                           java.util.Random randomGenerator)

  Deprecated.
  Constructs an Empirical distribution. The probability distribution function (pdf) is an array of positive real numbers. It need not be provided in the form of relative probabilities, absolute probabilities are also accepted. The `pdf` must satisfy both of the following conditions
  - `0.0 <= pdf[i] : 0<=i<=pdf.length-1`
  - `0.0 < Sum(pdf[i]) : 0<=i<=pdf.length-1`

  Parameters:
    `pdf` - the probability distribution function.
    `interpolationType` - can be either `Empirical.NO_INTERPOLATION` or `Empirical.LINEAR_INTERPOLATION`.
    `randomGenerator` - a uniform random number generator.
  Throws:
    `java.lang.IllegalArgumentException` - if at least one of the three conditions above is violated.

Method Detail

### cdf

    public double cdf(int k)

  Deprecated.
  Returns the cumulative distribution function.

### clone

    public java.lang.Object clone()

  Deprecated.
  Returns a deep copy of the receiver; the copy will produce identical sequences. After this call has returned, the copy and the receiver have equal but separate state.

  Overrides:
    `clone` in class `org.apache.mahout.math.PersistentObject`
  Returns:
    a copy of the receiver.

### nextInt

    public int nextInt()

  Deprecated.
  Returns a random integer `k` with probability `pdf(k)`.

  Specified by:
    `nextInt` in class `AbstractDiscreteDistribution`
  Returns:
    A random number from the distribution; returns `(int) Math.round(nextDouble())`. Override this method if necessary.

### pdf

    public double pdf(int k)

  Deprecated.
  Returns the probability distribution function.

### setState

    public void setState(double[] pdf,
                         int interpolationType)

  Deprecated.
  Sets the distribution parameters. The `pdf` must satisfy all of the following conditions
  - `pdf != null && pdf.length > 0`
  - `0.0 <= pdf[i] : 0 < =i <= pdf.length-1`
  - `0.0 < Sum(pdf[i]) : 0 <=i <= pdf.length-1`

  Parameters:
    `pdf` - probability distribution function.
  Throws:
    `java.lang.IllegalArgumentException` - if at least one of the three conditions above is violated.

### setState2

    public void setState2(double[] pdf)

  Deprecated.
  Sets the distribution parameters. The `pdf` must satisfy both of the following conditions
  - `0.0 <= pdf[i] : 0 < =i <= pdf.length-1`
  - `0.0 < Sum(pdf[i]) : 0 <=i <= pdf.length-1`

  Parameters:
    `pdf` - probability distribution function.
  Throws:
    `java.lang.IllegalArgumentException` - if at least one of the three conditions above is violated.

### toString

    public java.lang.String toString()

  Deprecated.
  Returns a String representation of the receiver.

  Overrides:
    `toString` in class `java.lang.Object`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.