|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.math.PersistentObject
org.apache.mahout.math.jet.random.AbstractDistribution
org.apache.mahout.math.jet.random.AbstractDiscreteDistribution
org.apache.mahout.math.jet.random.Binomial
@Deprecated public class Binomial
Field Summary |
---|
Fields inherited from class org.apache.mahout.math.jet.random.AbstractDistribution |
---|
randomGenerator |
Constructor Summary | |
---|---|
Binomial(int n,
double p,
RandomEngine randomGenerator)
Deprecated. Constructs a binomial distribution. |
Method Summary | |
---|---|
double |
cdf(int k)
Deprecated. Returns the cumulative distribution function. |
protected int |
generateBinomial(int n,
double p)
Deprecated. *************************************************************** * Binomial-Distribution - Acceptance Rejection/Inversion * * ***************************************************************** * Acceptance Rejection method combined with Inversion for * generating Binomial random numbers with parameters * n (number of trials) and p (probability of success). |
int |
nextInt()
Deprecated. Returns a random number from the distribution. |
int |
nextInt(int n,
double p)
Deprecated. Returns a random number from the distribution with the given parameters n and p; bypasses the internal state. |
double |
pdf(int k)
Deprecated. Returns the probability distribution function. |
void |
setNandP(int n,
double p)
Deprecated. Sets the parameters number of trials and the probability of success. |
static int |
staticNextInt(int n,
double p)
Deprecated. Returns a random number from the distribution with the given parameters n and p. |
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, clone, getRandomGenerator, makeDefaultGenerator, nextByte, nextChar, nextFloat, nextLong, setRandomGenerator |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Binomial(int n, double p, RandomEngine randomGenerator)
n
- the number of trials (also known as sample size).p
- the probability of success.randomGenerator
- a uniform random number generator.
java.lang.IllegalArgumentException
- if n*Math.min(p,1-p) <= 0.0Method Detail |
---|
public double cdf(int k)
protected int generateBinomial(int n, double p)
public int nextInt()
nextInt
in class AbstractDistribution
public int nextInt(int n, double p)
n
- the number of trialsp
- the probability of success.
java.lang.IllegalArgumentException
- if n*Math.min(p,1-p) <= 0.0public double pdf(int k)
public void setNandP(int n, double p)
n
- the number of trialsp
- the probability of success.
java.lang.IllegalArgumentException
- if n*Math.min(p,1-p) <= 0.0public static int staticNextInt(int n, double p)
n
- the number of trialsp
- the probability of success.
java.lang.IllegalArgumentException
- if n*Math.min(p,1-p) <= 0.0public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |