Examples of WeibullDistribution


Examples of org.apache.commons.math.distribution.WeibullDistribution

  public static Object statWeibull(Object[] args, XelContext ctx) throws MathException{
    double x = CommonFns.toNumber(args[0]).doubleValue();
    double alpha = CommonFns.toNumber(args[1]).doubleValue();
    double beta = CommonFns.toNumber(args[1]).doubleValue();
    DistributionFactory factory = DistributionFactory.newInstance();
    WeibullDistribution wb = factory.createWeibullDistribution(alpha, beta);
    return UtilFns.validateNumber(wb.cumulativeProbability(x));
  }
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

     * @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();
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

        TestUtils.assertChiSquareAccept(expected, counts, 0.001);
    }

    @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);
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

     * @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));
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

     * @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();
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

        TestUtils.assertChiSquareAccept(expected, counts, 0.001);
    }

    @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);
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

            container.add(comp, c);

            c.gridx++;
            comp = createComponent("Weibull", 0, 3,
                                   new String[] { "λ=0.5,k=1", "λ=1,k=1", "λ=1.5,k=1", "λ=5,k=1" },
                                   new WeibullDistribution(0.5, 1),
                                   new WeibullDistribution(1, 1),
                                   new WeibullDistribution(1.5, 1),
                                   new WeibullDistribution(5, 1));
            container.add(comp, c);
           
            JScrollPane scrollPane = new JScrollPane(container);
            add(scrollPane);
           
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

            {
                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);
            }
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

        }

        @Override
        public Distribution get()
        {
            return new DistributionOffsetApache(new WeibullDistribution(shape, scale), min, max);
        }
View Full Code Here

Examples of org.apache.commons.math3.distribution.WeibullDistribution

        TestUtils.assertChiSquareAccept(expected, counts, 0.001);
    }

    @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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.