Examples of increment()


Examples of org.apache.commons.math.stat.univariate.moment.Variance.increment()

        Kurtosis k = new Kurtosis(m4);

        for (int i = 0; i < testArray.length; i++){
            m4.increment(testArray[i]);
            m.increment(testArray[i]);
            v.increment(testArray[i]);
            s.increment(testArray[i]);
            k.increment(testArray[i]);
        }
       
        assertEquals(mean,m.getResult(),tolerance);
View Full Code Here

Examples of org.apache.commons.math3.stat.correlation.StorelessCovariance.increment()

    private void testSampler(final double[][] covMatrix, int samples, double epsilon) {
        CorrelatedRandomVectorGenerator sampler = createSampler(covMatrix);
       
        StorelessCovariance cov = new StorelessCovariance(covMatrix.length);
        for (int i = 0; i < samples; ++i) {
            cov.increment(sampler.nextVector());
        }

        double[][] sampleCov = cov.getData();
        for (int r = 0; r < covMatrix.length; ++r) {
            TestUtils.assertEquals(covMatrix[r], sampleCov[r], epsilon);
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.Mean.increment()

                    start = sample.timestamp;
                }
                if (sample.timestamp + sample.duration > finish) {
                    finish = sample.timestamp + sample.duration;
                }
                mean.increment(sample.duration);
                stdDev.increment(sample.duration);
                skewness.increment(sample.duration);
            }
        }
       
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment.increment()

    public void testMomentSmallSamples() {
        UnivariateStatistic stat = getUnivariateStatistic();
        if (stat instanceof SecondMoment) {
            SecondMoment moment = (SecondMoment) getUnivariateStatistic();
            Assert.assertTrue(Double.isNaN(moment.getResult()));
            moment.increment(1d);
            Assert.assertEquals(0d, moment.getResult(), 0);
        }
    }

    /**
 
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.Skewness.increment()

                if (sample.timestamp + sample.duration > finish) {
                    finish = sample.timestamp + sample.duration;
                }
                mean.increment(sample.duration);
                stdDev.increment(sample.duration);
                skewness.increment(sample.duration);
            }
        }
       
        double throughPut = (double)n * (double)TimeUnit.SECONDS.toNanos(1) / (double)(finish - start);
       
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.StandardDeviation.increment()

                }
                if (sample.timestamp + sample.duration > finish) {
                    finish = sample.timestamp + sample.duration;
                }
                mean.increment(sample.duration);
                stdDev.increment(sample.duration);
                skewness.increment(sample.duration);
            }
        }
       
        double throughPut = (double)n * (double)TimeUnit.SECONDS.toNanos(1) / (double)(finish - start);
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.Variance.increment()

                    // compute the distance variance of the current cluster
                    final T center = cluster.getCenter();
                    final Variance stat = new Variance();
                    for (final T point : cluster.getPoints()) {
                        stat.increment(point.distanceFrom(center));
                    }
                    varianceSum += stat.getResult();

                }
            }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.VectorialCovariance.increment()

        VectorialMean meanStat = new VectorialMean(mean.length);
        VectorialCovariance covStat = new VectorialCovariance(mean.length, true);
        for (int i = 0; i < 5000; ++i) {
            double[] v = generator.nextVector();
            meanStat.increment(v);
            covStat.increment(v);
        }

        double[] estimatedMean = meanStat.getResult();
        RealMatrix estimatedCovariance = covStat.getResult();
        for (int i = 0; i < estimatedMean.length; ++i) {
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.VectorialMean.increment()

        VectorialMean meanStat = new VectorialMean(mean.length);
        VectorialCovariance covStat = new VectorialCovariance(mean.length, true);
        for (int i = 0; i < 5000; ++i) {
            double[] v = generator.nextVector();
            meanStat.increment(v);
            covStat.increment(v);
        }

        double[] estimatedMean = meanStat.getResult();
        RealMatrix estimatedCovariance = covStat.getResult();
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.Max.increment()

            final int nextInt = r.nextInt(100000000);
            secondMoment.increment(nextInt);
            sum.increment(nextInt);
            sumsq.increment(nextInt);
            min.increment(nextInt);
            max.increment(nextInt);
            sumLog.increment(nextInt);
        }

        testStorelessUnivariateStatistic(secondMoment, 7.513432791665536E15);
        testStorelessUnivariateStatistic(sum, 6.01312177E8);
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.