import static java.lang.System.out;

 

import static javastat.util.DistributionType.*;

import javastat.util.*;

 

public class StatRandomExample

{

 

    public StatRandomExample() {}

 

    public static void main(String arg[])

    {

        StatRandom rng = new StatRandom();

        int n = 3;

        double [] normalData =

rng.random(NORMAL, new double[]{0.0, 1.0}, n);

        double [] uniformData =

rng.random(UNIFORM, new double[]{0.0, 1.0}, n);

        double [] betaData = rng.random(BETA, new double[]{2.0, 3.0}, n);

        double [] cauchyData =

rng.random(CAUCHY, new double[]{0.0, 1.0}, n);

        double [] chisqData =

rng.random(CHISQUARE, new double[]{1.0}, n);

        double [] exponData =

rng.random(EXPONENTIAL, new double[]{2.0}, n);

        double [] fData = rng.random(F, new double[]{1.0, 20.0}, n);

        double [] gammaData =

rng.random(GAMMA, new double[]{1.5, 2.5}, n);

        double [] hyperData = rng.random(HYPERGEOMETRIC,

                                       new double[]{4.0, 6.0, 7.0}, n);

        double [] logisData =

rng.random(LOGISTIC, new double[]{0.0, 1.0}, n);

        double [] lognorData =

rng.random(LOGNORMAL, new double[]{0.0, 1.0}, n);

        double [] tData = rng.random(T, new double[]{10.0}, n);

        double [] weibullData =

rng.random(WEIBULL, new double[]{1.0, 2.0}, n);

 

    }

 

}

 

Results:

The 1'th data

Normal         : 1.1107903782878445

Uniform        : 0.431295624486014

Beta           : 0.06538558574684489

Cauchy         : -7.420684526151573

Chi-square     : 0.25324050225779865

Exponential    : 2.3516612428432673

F              : 0.23021965638042188

Gamma          : 3.1037200225104664

Hypergeometric : 2.0

Logistic       : 1.3431025122432683

Log-normal     : 11.944086168909081

T              : -1.1319482833278212

Weibull        : 2.077214449733966

 

The 2'th data

Normal         : 1.0270266494039453

Uniform        : 0.5668357546378131

Beta           : 0.31485489433380165

Cauchy         : -0.1672925213813341

Chi-square     : 0.33818500269398905

Exponential    : 0.6411492565751327

F              : 0.0305127440399546

Gamma          : 0.3477446775311064

Hypergeometric : 4.0

Logistic       : -5.940587077055068

Log-normal     : 1.6258091741553802

T              : 1.2323545186333489

Weibull        : 0.38025351471000784

 

The 3'th data

Normal         : -0.7181223879037337

Uniform        : 0.9781036591740785

Beta           : 0.4017945461243272

Cauchy         : -0.6907526602860926

Chi-square     : 0.07701685587658089

Exponential    : 0.2953795426210699

F              : 0.9959282532694629

Gamma          : 0.43017326017559654

Hypergeometric : 3.0

Logistic       : -2.3394872969224374

Log-normal     : 3.7397663622101915

T              : 1.4490244352093824

Weibull        : 0.6280106574822993