Example usage for org.apache.commons.math3.distribution WeibullDistribution DEFAULT_INVERSE_ABSOLUTE_ACCURACY

List of usage examples for org.apache.commons.math3.distribution WeibullDistribution DEFAULT_INVERSE_ABSOLUTE_ACCURACY

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution WeibullDistribution DEFAULT_INVERSE_ABSOLUTE_ACCURACY.

Prototype

double DEFAULT_INVERSE_ABSOLUTE_ACCURACY

To view the source code for org.apache.commons.math3.distribution WeibullDistribution DEFAULT_INVERSE_ABSOLUTE_ACCURACY.

Click Source Link

Document

Default inverse cumulative probability accuracy.

Usage

From source file:adams.data.distribution.Weibull.java

/**
 * Adds options to the internal list of options.
 *///  w  w  w  .  j a  v  a 2 s  .  c o  m
@Override
public void defineOptions() {
    super.defineOptions();

    m_OptionManager.add("alpha", "alpha", 0.0);

    m_OptionManager.add("beta", "beta", 0.0);

    m_OptionManager.add("inverse-cum-accuracy", "inverseCumAccuracy",
            WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}

From source file:it.unibo.alchemist.model.implementations.timedistributions.WeibullTime.java

/**
 * @param shapeParameter//from   w  w  w.ja  v  a 2s.  c  o  m
 *            shape parameter for this distribution
 * @param scaleParameter
 *            shape parameter for this distribution
 * @param offsetParameter
 *            minimum possible time interval for this distribution
 * @param start
 *            initial time
 * @param random
 *            {@link RandomGenerator} used internally
 */
public WeibullTime(final double shapeParameter, final double scaleParameter, final double offsetParameter,
        final Time start, final RandomGenerator random) {
    this(random, new WeibullDistribution(random, shapeParameter, scaleParameter,
            WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY), offsetParameter, start);
}

From source file:it.unibo.alchemist.model.implementations.timedistributions.WeibullTime.java

/**
 * Generates a {@link WeibullDistribution} given its mean and stdev.
 * //from  ww w  .  j  ava 2  s.  c  o  m
 * @param mean
 *            the mean
 * @param deviation
 *            the stdev
 * @param random
 *            the random generator
 * @return a new {@link WeibullDistribution}
 */
protected static WeibullDistribution weibullFromMean(final double mean, final double deviation,
        final RandomGenerator random) {
    final double t = FastMath.log((deviation * deviation) / (mean * mean) + 1);
    double kmin = 0, kmax = 1;
    while (Gamma.logGamma(1 + 2 * kmax) - 2 * Gamma.logGamma(1 + kmax) < t) {
        kmin = kmax;
        kmax *= 2;
    }
    double k = (kmin + kmax) / 2;
    while (kmin < k && k < kmax) {
        if (Gamma.logGamma(1 + 2 * k) - 2 * Gamma.logGamma(1 + k) < t) {
            kmin = k;
        } else {
            kmax = k;
        }
        k = (kmin + kmax) / 2;
    }
    final double shapeParameter = 1 / k;
    final double scaleParameter = mean / FastMath.exp(Gamma.logGamma(1 + k));
    return new WeibullDistribution(random, shapeParameter, scaleParameter,
            WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}