当前位置: 首页>>代码示例>>Java>>正文


Java WeibullDistribution类代码示例

本文整理汇总了Java中org.apache.commons.math3.distribution.WeibullDistribution的典型用法代码示例。如果您正苦于以下问题:Java WeibullDistribution类的具体用法?Java WeibullDistribution怎么用?Java WeibullDistribution使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WeibullDistribution类属于org.apache.commons.math3.distribution包,在下文中一共展示了WeibullDistribution类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFactory

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public DistributionFactory getFactory(List<String> params)
{
    if (params.size() != 2)
        throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
    try
    {
        String[] bounds = params.get(0).split("\\.\\.+");
        final long min = parseLong(bounds[0]);
        final long max = parseLong(bounds[1]);
        if (min == max)
            return new FixedFactory(min);
        final double shape = Double.parseDouble(params.get(1));
        WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);
        // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
        // over entire range, but this results in overly skewed distribution, so take sqrt
        final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
        return new ExtremeFactory(min, max, shape, scale);
    } catch (Exception ignore)
    {
        throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:24,代码来源:OptionDistribution.java

示例2: getWeibull

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public RandomNumberDistribution<Double> getWeibull(
		final RandomNumberStream rng, final Number alpha, final Number beta)
{
	final RealDistribution dist = new WeibullDistribution(
			RandomNumberStream.Util.asCommonsRandomGenerator(rng),
			alpha.doubleValue(), beta.doubleValue());
	return new RandomNumberDistribution<Double>()
	{
		@Override
		public Double draw()
		{
			return dist.sample();
		}
	};
}
 
开发者ID:krevelen,项目名称:coala,代码行数:17,代码来源:RandomDistributionFactoryImpl.java

示例3: getFactory

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public DistributionFactory getFactory(List<String> params)
{
    if (params.size() != 2)
        throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
    try
    {
        String[] bounds = params.get(0).split("\\.\\.+");
        final long min = parseLong(bounds[0]);
        final long max = parseLong(bounds[1]);
        final double shape = Double.parseDouble(params.get(1));
        WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);
        // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
        // over entire range, but this results in overly skewed distribution, so take sqrt
        final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
        return new ExtremeFactory(min, max, shape, scale);
    } catch (Exception e)
    {
        throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
    }
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:22,代码来源:OptionDistribution.java

示例4: getFactory

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public DistributionFactory getFactory(List<String> params)
{
    if (params.size() != 2)
        throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
    try
    {
        String[] bounds = params.get(0).split("\\.\\.+");
        final long min = Long.parseLong(bounds[0]);
        final long max = Long.parseLong(bounds[1]);
        final double shape = Double.parseDouble(params.get(1));
        WeibullDistribution findBounds = new WeibullDistribution(shape, 1d);
        // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
        // over entire range, but this results in overly skewed distribution, so take sqrt
        final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
        return new ExtremeFactory(min, max, shape, scale);
    } catch (Exception _)
    {
        throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params);
    }
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:22,代码来源:OptionDistribution.java

示例5: testNextWeibull

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Test
public void testNextWeibull() {
    double[] quartiles = TestUtils.getDistributionQuartiles(new WeibullDistribution(1.2, 2.1));
    long[] counts = new long[4];
    randomData.reSeed(1000);
    for (int i = 0; i < 1000; i++) {
        double value = randomData.nextWeibull(1.2, 2.1);
        TestUtils.updateCounts(value, counts, quartiles);
    }
    TestUtils.assertChiSquareAccept(expected, counts, 0.001);
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:12,代码来源:RandomDataGeneratorTest.java

示例6: getNumericalMean

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public double getNumericalMean(Map<String, Double> parameters) throws Exception {
	return new WeibullDistribution(parameters.get("alpha"), parameters.get("lambda")).getNumericalMean();
}
 
开发者ID:boecker-lab,项目名称:passatuto,代码行数:5,代码来源:MLWeibullDistribution.java

示例7: getDensityUnprocessed

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public double getDensityUnprocessed(double x, Map<String, Double> parameters) throws Exception {
	return new WeibullDistribution(parameters.get("alpha"), parameters.get("lambda")).density(x);
}
 
开发者ID:boecker-lab,项目名称:passatuto,代码行数:5,代码来源:MLWeibullDistribution.java

示例8: getCumulativeProbabilityUnprocessed

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public double getCumulativeProbabilityUnprocessed(double x1, Map<String, Double> parameters) throws Exception {
	return new WeibullDistribution(parameters.get("alpha"), parameters.get("lambda")).cumulativeProbability(x1);
}
 
开发者ID:boecker-lab,项目名称:passatuto,代码行数:5,代码来源:MLWeibullDistribution.java

示例9: get

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public Distribution get()
{
    return new DistributionOffsetApache(new WeibullDistribution(new JDKRandomGenerator(), shape, scale, WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY), min, max);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:OptionDistribution.java

示例10: get

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
@Override
public Distribution get()
{
    return new DistributionOffsetApache(new WeibullDistribution(shape, scale), min, max);
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:6,代码来源:OptionDistribution.java

示例11: nextWeibull

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
/**
 * Generates a random value from the {@link WeibullDistribution Weibull Distribution}.
 *
 * @param shape the shape parameter of the Weibull distribution
 * @param scale the scale parameter of the Weibull distribution
 * @return random value sampled from the Weibull(shape, size) distribution
 * @throws NotStrictlyPositiveException if {@code shape <= 0} or
 * {@code scale <= 0}.
 */
public double nextWeibull(double shape, double scale) throws NotStrictlyPositiveException {
    return new WeibullDistribution(getRandomGenerator(), shape, scale,
            WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY).sample();
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:14,代码来源:RandomDataGenerator.java

示例12: nextWeibull

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
/**
 * Generates a random value from the {@link WeibullDistribution Weibull Distribution}.
 * This implementation uses {@link #nextInversionDeviate(RealDistribution) inversion}
 * to generate random values.
 *
 * @param shape the shape parameter of the Weibull distribution
 * @param scale the scale parameter of the Weibull distribution
 * @return random value sampled from the Weibull(shape, size) distribution
 * @since 2.2
 */
public double nextWeibull(double shape, double scale) {
    return nextInversionDeviate(new WeibullDistribution(shape, scale));
}
 
开发者ID:golharam,项目名称:FastQC,代码行数:14,代码来源:RandomDataImpl.java

示例13: WeibullDistr

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
/**
 * Instantiates a new Weibull pseudo random number generator.
 *
 * @param seed the seed
 * @param alpha the alpha
 * @param beta the beta
 */
public WeibullDistr(long seed, double alpha, double beta) {
    super(new WeibullDistribution(alpha, beta), seed);
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:11,代码来源:WeibullDistr.java

示例14: nextWeibull

import org.apache.commons.math3.distribution.WeibullDistribution; //导入依赖的package包/类
/**
 * Generates a random value from the {@link WeibullDistribution Weibull Distribution}.
 *
 * @param shape the shape parameter of the Weibull distribution
 * @param scale the scale parameter of the Weibull distribution
 * @return random value sampled from the Weibull(shape, size) distribution
 * @throws NotStrictlyPositiveException if {@code shape <= 0} or
 * {@code scale <= 0}.
 */
public double nextWeibull(double shape, double scale) throws NotStrictlyPositiveException {
    return new WeibullDistribution(getRan(), shape, scale,
            WeibullDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY).sample();
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:14,代码来源:RandomDataGenerator.java


注:本文中的org.apache.commons.math3.distribution.WeibullDistribution类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。