|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Random cc.mallet.util.Randoms
public class Randoms
Constructor Summary | |
---|---|
Randoms()
|
|
Randoms(int seed)
|
Method Summary | |
---|---|
java.util.Random |
asJavaRandom()
Deprecated. |
static void |
main(java.lang.String[] args)
|
double |
nextBeta(double alpha,
double beta)
Return a random double drawn from a Beta distribution with mean a/(a+b) and variance ab/((a+b+1)(a+b)^2). |
java.util.BitSet |
nextBitSet(int size,
double p)
Return a random BitSet with "size" bits, each having probability p of being true. |
boolean |
nextBoolean()
Return a random boolean, equally likely to be true or false. |
boolean |
nextBoolean(double p)
Return a random boolean, with probability p of being true. |
double |
nextChiSq()
Return a random double drawn from an Chi-squarted distribution with mean 1 and variance 2. |
double |
nextChiSq(int df)
Return a random double drawn from an Chi-squared distribution with mean df and variance 2*df. |
double |
nextChiSq(int df,
double lambda)
Return a random double drawn from an Chi-squared distribution with mean df+lambda and variance 2*df. |
int |
nextDiscrete(double[] a)
Draw a single sample from multinomial "a". |
int |
nextDiscrete(double[] a,
double sum)
draw a single sample from (unnormalized) multinomial "a", with normalizing factor "sum". |
double |
nextExp()
Return a random double drawn from an Exponential distribution with mean 1 and variance 1. |
double |
nextExp(double beta)
Return a random double drawn from an Exponential distribution with mean beta and variance beta^2. |
double |
nextExp(double beta,
double lambda)
Return a random double drawn from an Exponential distribution with mean beta+lambda and variance beta^2. |
double |
nextGamma()
Return a random double drawn from a Gamma distribution with mean 1.0 and variance 1.0. |
double |
nextGamma(double alpha)
Return a random double drawn from a Gamma distribution with mean alpha and variance 1.0. |
double |
nextGamma(double alpha,
double beta)
Return a random double drawn from a Gamma distribution with mean alpha*beta and variance alpha*beta^2. |
double |
nextGamma(double alpha,
double beta,
double lambda)
Return a random double drawn from a Gamma distribution with mean alpha*beta+lamba and variance alpha*beta^2. |
double |
nextGaussian()
Return a random double drawn from a Gaussian distribution with mean 0 and variance 1. |
double |
nextGaussian(double m,
double s2)
Return a random double drawn from a Gaussian distribution with mean m and variance s2. |
int |
nextPoisson()
Return nextPoisson(1). |
int |
nextPoisson(double lambda)
Return random integer from Poission with parameter lambda. |
double |
nextUniform()
Return a random double in the range 0 to 1, inclusive, uniformly sampled from that range. |
double |
nextUniform(double a,
double b)
Return a random double in the range a to b, inclusive, uniformly sampled from that range. |
double |
oldNextGamma(int ia)
|
Methods inherited from class java.util.Random |
---|
next, nextBytes, nextDouble, nextFloat, nextInt, nextInt, nextLong, setSeed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Randoms(int seed)
public Randoms()
Method Detail |
---|
public int nextPoisson(double lambda)
public int nextPoisson()
public boolean nextBoolean()
nextBoolean
in class java.util.Random
public boolean nextBoolean(double p)
public java.util.BitSet nextBitSet(int size, double p)
public double nextUniform()
public double nextUniform(double a, double b)
public int nextDiscrete(double[] a)
public int nextDiscrete(double[] a, double sum)
public double nextGaussian()
nextGaussian
in class java.util.Random
public double nextGaussian(double m, double s2)
public double nextGamma()
public double nextGamma(double alpha)
public double oldNextGamma(int ia)
public double nextGamma(double alpha, double beta)
public double nextGamma(double alpha, double beta, double lambda)
frac{ x^{alpha-1} exp(-x/beta) }{ beta^alpha Gamma(alpha) }
in other words, beta is a "scale" parameter. An alternative
parameterization would use 1/beta, the "rate" parameter.
public double nextExp()
public double nextExp(double beta)
public double nextExp(double beta, double lambda)
public double nextChiSq()
public double nextChiSq(int df)
public double nextChiSq(int df, double lambda)
public double nextBeta(double alpha, double beta)
@Deprecated public java.util.Random asJavaRandom()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |