Examples of PSquareMarkers


Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

    }

    @Test
    public void testMiscellaniousFunctionsInMarkers() {
        double p = 0.5;
        PSquareMarkers markers =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 0.02, 1.18, 9.15, 21.91,
                                38.62 }), p);
        // Markers equality
        Assert.assertTrue(markers.equals(markers));
        Assert.assertFalse(markers.equals(null));
        Assert.assertFalse(markers.equals(new String()));
        // Check for null markers test during equality testing
        // Until 5 elements markers are not initialized
        PSquarePercentile p1 = new PSquarePercentile(), p2 =
                new PSquarePercentile();
        Assert.assertEquals(p1, p2);
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

    }

    @Test
    public void testMarkers2() {
        double p = 0.5;
        PSquareMarkers markers =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 0.02, 1.18, 9.15, 21.91,
                                38.62 }), p);

        PSquareMarkers markersNew =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 0.02, 1.18, 9.15, 21.91,
                                38.62 }), p);

        Assert.assertTrue(markers.equals(markersNew));
        // If just one element of markers got changed then its still false.
        markersNew.processDataPoint(39);
        Assert.assertFalse(markers.equals(markersNew));

    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

        s.add(p);
        s.add(p2);
        Assert.assertEquals(1, s.size());
        Assert.assertEquals(p, s.iterator().next());

        PSquareMarkers m1 =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.0);
        PSquareMarkers m2 =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.0);
        Assert.assertTrue(m1.equals(m2));
        Set<PSquareMarkers> setMarkers = new LinkedHashSet<PSquareMarkers>();
        Assert.assertTrue(setMarkers.add(m1));
        Assert.assertFalse(setMarkers.add(m2));
        Assert.assertEquals(1, setMarkers.size());

        PSquareMarkers mThis =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 195.1772, 195.1567,
                                195.1937, 195.1959, 95.1442, 195.0610,
                                195.1591, 195.1195, 195.1772, 95.0925, 95.1990,
                                195.1682 }), 0.50);
        PSquareMarkers mThat =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.50);
        Assert.assertTrue(mThis.equals(mThis));
        Assert.assertFalse(mThis.equals(mThat));
        String s1="";
        Assert.assertFalse(mThis.equals(s1));
        for (int i = 0; i < testArray.length; i++) {
            mThat.processDataPoint(testArray[i]);
        }
        setMarkers.add(mThat);
        setMarkers.add(mThis);
        Assert.assertTrue(mThat.equals(mThat));
        Assert.assertTrue(setMarkers.contains(mThat));
        Assert.assertTrue(setMarkers.contains(mThis));
        Assert.assertEquals(3, setMarkers.size());
        Iterator<PSquareMarkers> iterator=setMarkers.iterator();
        Assert.assertEquals(m1, iterator.next());
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

        Assert.assertEquals(mThis, iterator.next());
    }

    @Test(expected = OutOfRangeException.class)
    public void testMarkersWithLowerIndex() {
        PSquareMarkers mThat =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.50);
        for (int i = 0; i < testArray.length; i++) {
            mThat.processDataPoint(testArray[i]);
        }
        mThat.estimate(0);
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

        mThat.estimate(0);
    }

    @Test(expected = OutOfRangeException.class)
    public void testMarkersWithHigherIndex() {
        PSquareMarkers mThat =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.50);
        for (int i = 0; i < testArray.length; i++) {
            mThat.processDataPoint(testArray[i]);
        }
        mThat.estimate(6);
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

        mThat.estimate(6);
    }

    @Test(expected = OutOfRangeException.class)
    public void testMarkerHeightWithLowerIndex() {
        PSquareMarkers mThat =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.50);
        mThat.height(0);
    }
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.PSquareMarkers

        mThat.height(0);
    }

    @Test(expected = OutOfRangeException.class)
    public void testMarkerHeightWithHigherIndex() {
        PSquareMarkers mThat =
                PSquarePercentile.newMarkers(
                        Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937,
                                95.1959, 95.1442, 95.0610, 95.1591, 95.1195,
                                95.1772, 95.0925, 95.1990, 95.1682 }), 0.50);
        mThat.height(6);
    }
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.