|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.data.random.Random
public class Random
Based on JMathArray's org.math.array.util.Random class. But in comparison to the original class, this one here is seedable and all methods are non-static.
| Nested Class Summary | |
|---|---|
static interface |
Random.Function
Based on JMathArray's org.math.array.util.Function. |
| Field Summary | |
|---|---|
protected RandomSeedable |
m_RandEngine
the random number generator. |
| Constructor Summary | |
|---|---|
Random()
Initializes the random number generator with a default (but fixed) seed value. |
|
Random(long seed)
Initializes the random number generator with the specified seed value. |
|
| Method Summary | |
|---|---|
double |
beta(double a,
double b)
Generate a random number from a beta random variable. |
double |
cauchy(double mu,
double sigma)
Generate a random number from a Cauchy random variable (Mean = Inf, and Variance = Inf). |
double |
chi2(int n)
Generate a random number from a Chi-2 random variable. |
double |
dirac(double[] values,
double[] prob)
Generate a random number from a discrete random variable. |
double |
exponential(double lambda)
Generate a random number from an exponantial random variable (Mean = 1/lambda, variance = 1/lambda^2). |
double |
logNormal(double mu,
double sigma)
Generate a random number from a LogNormal random variable. |
double |
normal(double mu,
double sigma)
Generate a random number from a Gaussian (Normal) random variable. |
int |
randInt(int i0,
int i1)
Generate a random integer. |
double |
raw()
Generate a random number between 0 and 1. |
double |
rejection(Random.Function fun,
double maxFun,
double min,
double max)
Generate a random number from a random variable definied by its density function, using the rejection technic. |
double |
triangular(double min,
double max)
Generate a random number from a symetric triangular random variable. |
double |
triangular(double min,
double med,
double max)
Generate a random number from a non-symetric triangular random variable. |
double |
uniform(double min,
double max)
Generate a random number from a uniform random variable. |
double |
weibull(double lambda,
double c)
Generate a random number from a Weibull random variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RandomSeedable m_RandEngine
| Constructor Detail |
|---|
public Random()
public Random(long seed)
seed - the seed value to use| Method Detail |
|---|
public double raw()
public int randInt(int i0,
int i1)
i0 - Min of the random variable.i1 - Max of the random variable.
public double uniform(double min,
double max)
min - Min of the random variable.max - Max of the random variable.
public double dirac(double[] values,
double[] prob)
values - Discrete values.prob - Probability of each value.
public double normal(double mu,
double sigma)
mu - Mean of the random variable.sigma - Standard deviation of the random variable.
public double chi2(int n)
n - Degrees of freedom of the chi2 random variable.
public double logNormal(double mu,
double sigma)
mu - Mean of the Normal random variable.sigma - Standard deviation of the Normal random variable.
public double exponential(double lambda)
lambda - Parmaeter of the exponential random variable.
public double triangular(double min,
double max)
min - Min of the random variable.max - Max of the random variable.
public double triangular(double min,
double med,
double max)
min - Min of the random variable.med - Value of the random variable with max density.max - Max of the random variable.
public double beta(double a,
double b)
a - First parameter of the Beta random variable.b - Second parameter of the Beta random variable.
public double cauchy(double mu,
double sigma)
mu - Median of the Weibull random variablesigma - Second parameter of the Cauchy random variable.
public double weibull(double lambda,
double c)
lambda - First parameter of the Weibull random variable.c - Second parameter of the Weibull random variable.
public double rejection(Random.Function fun,
double maxFun,
double min,
double max)
fun - Density function (may be not normalized) of the random
variable.maxFun - Max of the function.min - Min of the random variable.max - Max of the random variable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||