|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprea.util.Distribution
public class Distribution
This class implements several statistical distributions. Note that we use UJMP package (http://www.ujmp.org) to implement this class. Each distribution provides random sampling methods.
Constructor Summary | |
---|---|
Distribution()
|
Method Summary | |
---|---|
static double[] |
gammaDistribution(double alpha,
double scale,
int count)
Randomly sample several points from Gamma Distribution with the given parameters. |
static double |
gammaRandom(double alpha,
double scale)
Randomly sample 1 point from Gamma Distribution with the given parameters. |
static double[] |
normalDistribution(double mean,
double std,
int count)
Randomly sample several points from Normal Distribution with the given mean and standard deviation. |
static double |
normalRandom(double mean,
double std)
Randomly sample 1 point from Normal Distribution with the given mean and standard deviation. |
static SparseMatrix |
wishartRandom(SparseMatrix scale,
double df)
Randomly sample a matrix from Wishart Distribution with the given parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Distribution()
Method Detail |
---|
public static double normalRandom(double mean, double std)
mean
- Mean of this Normal Distribution.std
- Standard deviation of this Normal Distribution.
public static double[] normalDistribution(double mean, double std, int count)
mean
- Mean of this Normal Distribution.std
- Standard deviation of this Normal Distribution.count
- The number of samples to draw.
public static double gammaRandom(double alpha, double scale)
alpha
- Alpha parameter for Gamma Distribution.scale
- Scale parameter for Gamma Distribution.
java.lang.IllegalArgumentException
- if arguments are out of range.public static double[] gammaDistribution(double alpha, double scale, int count)
alpha
- Alpha parameter for Gamma Distribution.scale
- Scale parameter for Gamma Distribution.count
- The number of samples to draw.
public static SparseMatrix wishartRandom(SparseMatrix scale, double df)
scale
- Scale parameter for Wishart Distribution.df
- Degree of freedom for Wishart Distribution.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |