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("Normal         : " + normalData[i]);

        print("Hypergeometric : " + hyperData[i]);

        print("Weibull        : " + weibullData[i]);

}

 

Results:

Normal         : -0.643

Hypergeometric  : 3.0

Weibull         : 1.899

Normal         : -3.567

Hypergeometric : 3.0

Weibull        : 0.146

Normal        : 0.689

Hypergeometric : 3.0

Weibull        : 2.265

Normal        : 0.653

Hypergeometric : 3.0

Weibull        : 0.458

Normal        : 0.931

Hypergeometric : 3.0

Weibull        : 0.068

Normal        : 0.412

Hypergeometric : 3.0

Weibull        : 11.349

Normal        : 0.286

Hypergeometric : 3.0

Weibull        : 1.399

Normal        : -0.246

Hypergeometric : 2.0

Weibull        : 0.728

Normal        : -1.075

Hypergeometric : 3.0

Weibull        : 0.528

Normal        : -0.932

Hypergeometric : 2.0

Weibull        : 8.283