Examples of SecondMoment


Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment

    @Test
    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.SecondMoment

     */
    public double calculateTotalSumOfSquares() {
        if (isNoIntercept()) {
            return StatUtils.sumSq(getY().toArray());
        } else {
            return new SecondMoment().evaluate(getY().toArray());
        }
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment

     */
    public double calculateTotalSumOfSquares() throws MathIllegalArgumentException {
        if (isNoIntercept()) {
            return StatUtils.sumSq(getY().toArray());
        } else {
            return new SecondMoment().evaluate(getY().toArray());
        }
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment

     */
    public double calculateTotalSumOfSquares() throws MathIllegalArgumentException {
        if (isNoIntercept()) {
            return StatUtils.sumSq(getY().toArray());
        } else {
            return new SecondMoment().evaluate(getY().toArray());
        }
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment

    @Test
    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.SecondMoment

   
    @Ignore
    @Test
    public void testSummaryStatisticsJson() throws Exception {
        final SecondMoment secondMoment = new SecondMoment();
        final Sum sum = new Sum();
        final SumOfSquares sumsq = new SumOfSquares();
        final Min min = new Min();
        final Max max = new Max();
        final SumOfLogs sumLog = new SumOfLogs();
       
        final Random r = new Random(0);
        for (int i = 0; i < 10; i++) {
            final int nextInt = r.nextInt(100000000);
            secondMoment.increment(nextInt);
            sum.increment(nextInt);
            sumsq.increment(nextInt);
            min.increment(nextInt);
            max.increment(nextInt);
            sumLog.increment(nextInt);
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment

   
    //***** ALL FIELDS ARE LAZILY INITIALIZED HERE *****//
   
    private SecondMoment _getSecondMoment() {
        if (this.secondMoment == null) {
            this.secondMoment = new SecondMoment();
        }
        return this.secondMoment;
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.moment.SecondMoment

    @Test
    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
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.