import javastat.util.StatRandom;
import javastat.util.DistributionType;
StatRandom rng = new StatRandom();
int n = 10;
normalData = rng.random(DistributionType.NORMAL,
new double[]{0.0, 1.0}, n);
uniformData = rng.random(DistributionType.UNIFORM,
new double[]{0.0, 1.0}, n);
betaData = rng.random(DistributionType.BETA, new double[]{2.0, 3.0}, n);
cauchyData = rng.random(DistributionType.CAUCHY,
new double[]{0.0, 1.0}, n);
chisqData = rng.random(DistributionType.CHISQUARE, new double[]{1.0}, n);
exponData = rng.random(DistributionType.EXPONENTIAL,
new double[]{2.0}, n);
fData = rng.random(DistributionType.F, new double[]{1.0, 20.0}, n);
gammaData = rng.random(DistributionType.GAMMA,
new double[]{1.5, 2.5}, n);
hyperData = rng.random(DistributionType.HYPERGEOMETRIC,
new double[]{4.0, 6.0, 7.0}, n);
logisData = rng.random(DistributionType.LOGISTIC, new double[]{0.0, 1.0}, n);
lognorData = rng.random(DistributionType.LOGNORMAL,
new double[]{0.0, 1.0}, n);
tData = rng.random(DistributionType.T, new double[]{10.0}, n);
weibullData = rng.random(DistributionType.WEIBULL,
new double[]{1.0, 2.0}, n);
for(int i =0; i
< n; i++)
{
print("
print("Hypergeometric :
" + hyperData[i]);
print("Weibull : "
+ weibullData[i]);
}
Results:
Hypergeometric : 3.0
Weibull : 1.899
Hypergeometric : 3.0
Weibull :
0.146
Hypergeometric : 3.0
Weibull :
2.265
Hypergeometric : 3.0
Weibull :
0.458
Hypergeometric : 3.0
Weibull :
0.068
Hypergeometric : 3.0
Weibull :
11.349
Hypergeometric : 3.0
Weibull :
1.399
Hypergeometric : 2.0
Weibull :
0.728
Hypergeometric : 3.0
Weibull :
0.528
Hypergeometric : 2.0
Weibull :
8.283