lundi 18 mai 2015

Random number generation with weibull distribution in java

I want to generate random number from a weibull distribution with given shape and scale factor. I used the below code but the values generated are always close to beta. How to change the range of values?

public double weibull(double eta, double beta)              
{               
    RandomGenerator rg = new JDKRandomGenerator();
    WeibullDistribution g= new WeibullDistribution(rg, eta, beta, WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    return g.sample();
}




Aucun commentaire:

Enregistrer un commentaire