commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r948064 [38/38] - in /websites/production/commons/content/proper/commons-math/testapidocs: ./ org/apache/commons/math3/ org/apache/commons/math3/analysis/ org/apache/commons/math3/analysis/class-use/ org/apache/commons/math3/analysis/differ...
Date Fri, 17 Apr 2015 19:44:43 GMT
Modified: websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/stat/regression/SimpleRegressionTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/stat/regression/SimpleRegressionTest.html
(original)
+++ websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/stat/regression/SimpleRegressionTest.html
Fri Apr 17 19:43:52 2015
@@ -555,138 +555,154 @@
 <span class="sourceLineNo">547</span>        Assert.assertTrue(regression.getSlope()
&gt; 0.0);<a name="line.547"></a>
 <span class="sourceLineNo">548</span>        Assert.assertTrue(regression.getSumSquaredErrors()
&gt;= 0.0);<a name="line.548"></a>
 <span class="sourceLineNo">549</span>    }<a name="line.549"></a>
-<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">550</span>    <a name="line.550"></a>
 <span class="sourceLineNo">551</span>    @Test<a name="line.551"></a>
-<span class="sourceLineNo">552</span>    public void testPerfectNegative() {<a
name="line.552"></a>
+<span class="sourceLineNo">552</span>    public void testPerfect2() {<a name="line.552"></a>
 <span class="sourceLineNo">553</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.553"></a>
-<span class="sourceLineNo">554</span>        int n = 100;<a name="line.554"></a>
-<span class="sourceLineNo">555</span>        for (int i = 0; i &lt; n; i++)
{<a name="line.555"></a>
-<span class="sourceLineNo">556</span>            regression.addData(- ((double)
i) / (n - 1), i);<a name="line.556"></a>
-<span class="sourceLineNo">557</span>        }<a name="line.557"></a>
-<span class="sourceLineNo">558</span><a name="line.558"></a>
-<span class="sourceLineNo">559</span>        Assert.assertEquals(0.0, regression.getSignificance(),
1.0e-5);<a name="line.559"></a>
-<span class="sourceLineNo">560</span>        Assert.assertTrue(regression.getSlope()
&lt; 0.0);<a name="line.560"></a>
-<span class="sourceLineNo">561</span>    }<a name="line.561"></a>
-<span class="sourceLineNo">562</span><a name="line.562"></a>
-<span class="sourceLineNo">563</span>    @Test<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    public void testRandom() {<a name="line.564"></a>
-<span class="sourceLineNo">565</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.565"></a>
-<span class="sourceLineNo">566</span>        Random random = new Random(1);<a
name="line.566"></a>
-<span class="sourceLineNo">567</span>        int n = 100;<a name="line.567"></a>
-<span class="sourceLineNo">568</span>        for (int i = 0; i &lt; n; i++)
{<a name="line.568"></a>
-<span class="sourceLineNo">569</span>            regression.addData(((double)
i) / (n - 1), random.nextDouble());<a name="line.569"></a>
-<span class="sourceLineNo">570</span>        }<a name="line.570"></a>
-<span class="sourceLineNo">571</span><a name="line.571"></a>
-<span class="sourceLineNo">572</span>        Assert.assertTrue( 0.0 &lt;
regression.getSignificance()<a name="line.572"></a>
-<span class="sourceLineNo">573</span>                    &amp;&amp; regression.getSignificance()
&lt; 1.0);<a name="line.573"></a>
-<span class="sourceLineNo">574</span>    }<a name="line.574"></a>
-<span class="sourceLineNo">575</span><a name="line.575"></a>
-<span class="sourceLineNo">576</span><a name="line.576"></a>
-<span class="sourceLineNo">577</span>    // Jira MATH-85 = Bugzilla 39432<a
name="line.577"></a>
-<span class="sourceLineNo">578</span>    @Test<a name="line.578"></a>
-<span class="sourceLineNo">579</span>    public void testSSENonNegative() {<a
name="line.579"></a>
-<span class="sourceLineNo">580</span>        double[] y = { 8915.102, 8919.302,
8923.502 };<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        double[] x = { 1.107178495E2, 1.107264895E2,
1.107351295E2 };<a name="line.581"></a>
-<span class="sourceLineNo">582</span>        SimpleRegression reg = new SimpleRegression();<a
name="line.582"></a>
-<span class="sourceLineNo">583</span>        for (int i = 0; i &lt; x.length;
i++) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>            reg.addData(x[i], y[i]);<a
name="line.584"></a>
-<span class="sourceLineNo">585</span>        }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>        Assert.assertTrue(reg.getSumSquaredErrors()
&gt;= 0.0);<a name="line.586"></a>
-<span class="sourceLineNo">587</span>    }<a name="line.587"></a>
-<span class="sourceLineNo">588</span><a name="line.588"></a>
-<span class="sourceLineNo">589</span>    // Test remove X,Y (single observation)<a
name="line.589"></a>
-<span class="sourceLineNo">590</span>    @Test<a name="line.590"></a>
-<span class="sourceLineNo">591</span>    public void testRemoveXY() {<a name="line.591"></a>
-<span class="sourceLineNo">592</span>        // Create regression with inference
data then remove to test<a name="line.592"></a>
-<span class="sourceLineNo">593</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.593"></a>
-<span class="sourceLineNo">594</span>        regression.addData(infData);<a
name="line.594"></a>
-<span class="sourceLineNo">595</span>        regression.removeData(removeX, removeY);<a
name="line.595"></a>
-<span class="sourceLineNo">596</span>        regression.addData(removeX, removeY);<a
name="line.596"></a>
-<span class="sourceLineNo">597</span>        // Use the inference assertions
to make sure that everything worked<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        Assert.assertEquals("slope std err",
0.011448491,<a name="line.598"></a>
-<span class="sourceLineNo">599</span>                regression.getSlopeStdErr(),
1E-10);<a name="line.599"></a>
-<span class="sourceLineNo">600</span>        Assert.assertEquals("std err intercept",
0.286036932,<a name="line.600"></a>
-<span class="sourceLineNo">601</span>                regression.getInterceptStdErr(),1E-8);<a
name="line.601"></a>
-<span class="sourceLineNo">602</span>        Assert.assertEquals("significance",
4.596e-07,<a name="line.602"></a>
-<span class="sourceLineNo">603</span>                regression.getSignificance(),1E-8);<a
name="line.603"></a>
-<span class="sourceLineNo">604</span>        Assert.assertEquals("slope conf
interval half-width", 0.0270713794287,<a name="line.604"></a>
-<span class="sourceLineNo">605</span>                regression.getSlopeConfidenceInterval(),1E-8);<a
name="line.605"></a>
-<span class="sourceLineNo">606</span>     }<a name="line.606"></a>
-<span class="sourceLineNo">607</span><a name="line.607"></a>
-<span class="sourceLineNo">608</span><a name="line.608"></a>
-<span class="sourceLineNo">609</span>    // Test remove single observation in
array<a name="line.609"></a>
-<span class="sourceLineNo">610</span>    @Test<a name="line.610"></a>
-<span class="sourceLineNo">611</span>    public void testRemoveSingle() {<a
name="line.611"></a>
-<span class="sourceLineNo">612</span>        // Create regression with inference
data then remove to test<a name="line.612"></a>
-<span class="sourceLineNo">613</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.613"></a>
-<span class="sourceLineNo">614</span>        regression.addData(infData);<a
name="line.614"></a>
-<span class="sourceLineNo">615</span>        regression.removeData(removeSingle);<a
name="line.615"></a>
-<span class="sourceLineNo">616</span>        regression.addData(removeSingle);<a
name="line.616"></a>
-<span class="sourceLineNo">617</span>        // Use the inference assertions
to make sure that everything worked<a name="line.617"></a>
-<span class="sourceLineNo">618</span>        Assert.assertEquals("slope std err",
0.011448491,<a name="line.618"></a>
-<span class="sourceLineNo">619</span>                regression.getSlopeStdErr(),
1E-10);<a name="line.619"></a>
-<span class="sourceLineNo">620</span>        Assert.assertEquals("std err intercept",
0.286036932,<a name="line.620"></a>
-<span class="sourceLineNo">621</span>                regression.getInterceptStdErr(),1E-8);<a
name="line.621"></a>
-<span class="sourceLineNo">622</span>        Assert.assertEquals("significance",
4.596e-07,<a name="line.622"></a>
-<span class="sourceLineNo">623</span>                regression.getSignificance(),1E-8);<a
name="line.623"></a>
-<span class="sourceLineNo">624</span>        Assert.assertEquals("slope conf
interval half-width", 0.0270713794287,<a name="line.624"></a>
-<span class="sourceLineNo">625</span>                regression.getSlopeConfidenceInterval(),1E-8);<a
name="line.625"></a>
-<span class="sourceLineNo">626</span>     }<a name="line.626"></a>
-<span class="sourceLineNo">627</span><a name="line.627"></a>
-<span class="sourceLineNo">628</span>    // Test remove multiple observations<a
name="line.628"></a>
-<span class="sourceLineNo">629</span>    @Test<a name="line.629"></a>
-<span class="sourceLineNo">630</span>    public void testRemoveMultiple() {<a
name="line.630"></a>
-<span class="sourceLineNo">631</span>        // Create regression with inference
data then remove to test<a name="line.631"></a>
-<span class="sourceLineNo">632</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.632"></a>
-<span class="sourceLineNo">633</span>        regression.addData(infData);<a
name="line.633"></a>
-<span class="sourceLineNo">634</span>        regression.removeData(removeMultiple);<a
name="line.634"></a>
-<span class="sourceLineNo">635</span>        regression.addData(removeMultiple);<a
name="line.635"></a>
-<span class="sourceLineNo">636</span>        // Use the inference assertions
to make sure that everything worked<a name="line.636"></a>
-<span class="sourceLineNo">637</span>        Assert.assertEquals("slope std err",
0.011448491,<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                regression.getSlopeStdErr(),
1E-10);<a name="line.638"></a>
-<span class="sourceLineNo">639</span>        Assert.assertEquals("std err intercept",
0.286036932,<a name="line.639"></a>
-<span class="sourceLineNo">640</span>                regression.getInterceptStdErr(),1E-8);<a
name="line.640"></a>
-<span class="sourceLineNo">641</span>        Assert.assertEquals("significance",
4.596e-07,<a name="line.641"></a>
-<span class="sourceLineNo">642</span>                regression.getSignificance(),1E-8);<a
name="line.642"></a>
-<span class="sourceLineNo">643</span>        Assert.assertEquals("slope conf
interval half-width", 0.0270713794287,<a name="line.643"></a>
-<span class="sourceLineNo">644</span>                regression.getSlopeConfidenceInterval(),1E-8);<a
name="line.644"></a>
-<span class="sourceLineNo">645</span>     }<a name="line.645"></a>
-<span class="sourceLineNo">646</span><a name="line.646"></a>
-<span class="sourceLineNo">647</span>    // Remove observation when empty<a
name="line.647"></a>
-<span class="sourceLineNo">648</span>    @Test<a name="line.648"></a>
-<span class="sourceLineNo">649</span>    public void testRemoveObsFromEmpty()
{<a name="line.649"></a>
-<span class="sourceLineNo">650</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.650"></a>
-<span class="sourceLineNo">651</span>        regression.removeData(removeX, removeY);<a
name="line.651"></a>
-<span class="sourceLineNo">652</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.652"></a>
-<span class="sourceLineNo">653</span>    }<a name="line.653"></a>
-<span class="sourceLineNo">654</span><a name="line.654"></a>
-<span class="sourceLineNo">655</span>    // Remove single observation to empty<a
name="line.655"></a>
-<span class="sourceLineNo">656</span>    @Test<a name="line.656"></a>
-<span class="sourceLineNo">657</span>    public void testRemoveObsFromSingle()
{<a name="line.657"></a>
-<span class="sourceLineNo">658</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.658"></a>
-<span class="sourceLineNo">659</span>        regression.addData(removeX, removeY);<a
name="line.659"></a>
-<span class="sourceLineNo">660</span>        regression.removeData(removeX, removeY);<a
name="line.660"></a>
-<span class="sourceLineNo">661</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.661"></a>
-<span class="sourceLineNo">662</span>    }<a name="line.662"></a>
-<span class="sourceLineNo">663</span><a name="line.663"></a>
-<span class="sourceLineNo">664</span>    // Remove multiple observations to empty<a
name="line.664"></a>
-<span class="sourceLineNo">665</span>    @Test<a name="line.665"></a>
-<span class="sourceLineNo">666</span>    public void testRemoveMultipleToEmpty()
{<a name="line.666"></a>
-<span class="sourceLineNo">667</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.667"></a>
-<span class="sourceLineNo">668</span>        regression.addData(removeMultiple);<a
name="line.668"></a>
-<span class="sourceLineNo">669</span>        regression.removeData(removeMultiple);<a
name="line.669"></a>
-<span class="sourceLineNo">670</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.670"></a>
-<span class="sourceLineNo">671</span>    }<a name="line.671"></a>
-<span class="sourceLineNo">672</span><a name="line.672"></a>
-<span class="sourceLineNo">673</span>    // Remove multiple observations past
empty (i.e. size of array &gt; n)<a name="line.673"></a>
-<span class="sourceLineNo">674</span>    @Test<a name="line.674"></a>
-<span class="sourceLineNo">675</span>    public void testRemoveMultiplePastEmpty()
{<a name="line.675"></a>
-<span class="sourceLineNo">676</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.676"></a>
-<span class="sourceLineNo">677</span>        regression.addData(removeX, removeY);<a
name="line.677"></a>
-<span class="sourceLineNo">678</span>        regression.removeData(removeMultiple);<a
name="line.678"></a>
-<span class="sourceLineNo">679</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>    }<a name="line.680"></a>
-<span class="sourceLineNo">681</span>}<a name="line.681"></a>
+<span class="sourceLineNo">554</span>        System.out.println("getXSumSquares()="
+ regression.getXSumSquares()); // TODO temp check to see why Jenkins H10 is failing<a
name="line.554"></a>
+<span class="sourceLineNo">555</span>        regression.addData(0, 0);<a name="line.555"></a>
+<span class="sourceLineNo">556</span>        System.out.println("getXSumSquares()="
+ regression.getXSumSquares()); // TODO temp check to see why Jenkins H10 is failing<a
name="line.556"></a>
+<span class="sourceLineNo">557</span>        regression.addData(1, 1);<a name="line.557"></a>
+<span class="sourceLineNo">558</span>        System.out.println("getXSumSquares()="
+ regression.getXSumSquares()); // TODO temp check to see why Jenkins H10 is failing<a
name="line.558"></a>
+<span class="sourceLineNo">559</span>        regression.addData(2, 2);<a name="line.559"></a>
+<span class="sourceLineNo">560</span>        System.out.println("getXSumSquares()="
+ regression.getXSumSquares()); // TODO temp check to see why Jenkins H10 is failing<a
name="line.560"></a>
+<span class="sourceLineNo">561</span>        System.out.println("getMeanSquareError()="
+ regression.getMeanSquareError()); // TODO temp check to see why Jenkins H10/H11 is failing<a
name="line.561"></a>
+<span class="sourceLineNo">562</span>        Assert.assertEquals(0.0, regression.getSlopeStdErr(),
0.0);<a name="line.562"></a>
+<span class="sourceLineNo">563</span>        Assert.assertEquals(0.0, regression.getSignificance(),
Double.MIN_VALUE);<a name="line.563"></a>
+<span class="sourceLineNo">564</span>        Assert.assertEquals(1, regression.getRSquare(),
Double.MIN_VALUE);<a name="line.564"></a>
+<span class="sourceLineNo">565</span>    }<a name="line.565"></a>
+<span class="sourceLineNo">566</span><a name="line.566"></a>
+<span class="sourceLineNo">567</span>    @Test<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    public void testPerfectNegative() {<a
name="line.568"></a>
+<span class="sourceLineNo">569</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.569"></a>
+<span class="sourceLineNo">570</span>        int n = 100;<a name="line.570"></a>
+<span class="sourceLineNo">571</span>        for (int i = 0; i &lt; n; i++)
{<a name="line.571"></a>
+<span class="sourceLineNo">572</span>            regression.addData(- ((double)
i) / (n - 1), i);<a name="line.572"></a>
+<span class="sourceLineNo">573</span>        }<a name="line.573"></a>
+<span class="sourceLineNo">574</span><a name="line.574"></a>
+<span class="sourceLineNo">575</span>        Assert.assertEquals(0.0, regression.getSignificance(),
1.0e-5);<a name="line.575"></a>
+<span class="sourceLineNo">576</span>        Assert.assertTrue(regression.getSlope()
&lt; 0.0);<a name="line.576"></a>
+<span class="sourceLineNo">577</span>    }<a name="line.577"></a>
+<span class="sourceLineNo">578</span><a name="line.578"></a>
+<span class="sourceLineNo">579</span>    @Test<a name="line.579"></a>
+<span class="sourceLineNo">580</span>    public void testRandom() {<a name="line.580"></a>
+<span class="sourceLineNo">581</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.581"></a>
+<span class="sourceLineNo">582</span>        Random random = new Random(1);<a
name="line.582"></a>
+<span class="sourceLineNo">583</span>        int n = 100;<a name="line.583"></a>
+<span class="sourceLineNo">584</span>        for (int i = 0; i &lt; n; i++)
{<a name="line.584"></a>
+<span class="sourceLineNo">585</span>            regression.addData(((double)
i) / (n - 1), random.nextDouble());<a name="line.585"></a>
+<span class="sourceLineNo">586</span>        }<a name="line.586"></a>
+<span class="sourceLineNo">587</span><a name="line.587"></a>
+<span class="sourceLineNo">588</span>        Assert.assertTrue( 0.0 &lt;
regression.getSignificance()<a name="line.588"></a>
+<span class="sourceLineNo">589</span>                    &amp;&amp; regression.getSignificance()
&lt; 1.0);<a name="line.589"></a>
+<span class="sourceLineNo">590</span>    }<a name="line.590"></a>
+<span class="sourceLineNo">591</span><a name="line.591"></a>
+<span class="sourceLineNo">592</span><a name="line.592"></a>
+<span class="sourceLineNo">593</span>    // Jira MATH-85 = Bugzilla 39432<a
name="line.593"></a>
+<span class="sourceLineNo">594</span>    @Test<a name="line.594"></a>
+<span class="sourceLineNo">595</span>    public void testSSENonNegative() {<a
name="line.595"></a>
+<span class="sourceLineNo">596</span>        double[] y = { 8915.102, 8919.302,
8923.502 };<a name="line.596"></a>
+<span class="sourceLineNo">597</span>        double[] x = { 1.107178495E2, 1.107264895E2,
1.107351295E2 };<a name="line.597"></a>
+<span class="sourceLineNo">598</span>        SimpleRegression reg = new SimpleRegression();<a
name="line.598"></a>
+<span class="sourceLineNo">599</span>        for (int i = 0; i &lt; x.length;
i++) {<a name="line.599"></a>
+<span class="sourceLineNo">600</span>            reg.addData(x[i], y[i]);<a
name="line.600"></a>
+<span class="sourceLineNo">601</span>        }<a name="line.601"></a>
+<span class="sourceLineNo">602</span>        Assert.assertTrue(reg.getSumSquaredErrors()
&gt;= 0.0);<a name="line.602"></a>
+<span class="sourceLineNo">603</span>    }<a name="line.603"></a>
+<span class="sourceLineNo">604</span><a name="line.604"></a>
+<span class="sourceLineNo">605</span>    // Test remove X,Y (single observation)<a
name="line.605"></a>
+<span class="sourceLineNo">606</span>    @Test<a name="line.606"></a>
+<span class="sourceLineNo">607</span>    public void testRemoveXY() {<a name="line.607"></a>
+<span class="sourceLineNo">608</span>        // Create regression with inference
data then remove to test<a name="line.608"></a>
+<span class="sourceLineNo">609</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.609"></a>
+<span class="sourceLineNo">610</span>        regression.addData(infData);<a
name="line.610"></a>
+<span class="sourceLineNo">611</span>        regression.removeData(removeX, removeY);<a
name="line.611"></a>
+<span class="sourceLineNo">612</span>        regression.addData(removeX, removeY);<a
name="line.612"></a>
+<span class="sourceLineNo">613</span>        // Use the inference assertions
to make sure that everything worked<a name="line.613"></a>
+<span class="sourceLineNo">614</span>        Assert.assertEquals("slope std err",
0.011448491,<a name="line.614"></a>
+<span class="sourceLineNo">615</span>                regression.getSlopeStdErr(),
1E-10);<a name="line.615"></a>
+<span class="sourceLineNo">616</span>        Assert.assertEquals("std err intercept",
0.286036932,<a name="line.616"></a>
+<span class="sourceLineNo">617</span>                regression.getInterceptStdErr(),1E-8);<a
name="line.617"></a>
+<span class="sourceLineNo">618</span>        Assert.assertEquals("significance",
4.596e-07,<a name="line.618"></a>
+<span class="sourceLineNo">619</span>                regression.getSignificance(),1E-8);<a
name="line.619"></a>
+<span class="sourceLineNo">620</span>        Assert.assertEquals("slope conf
interval half-width", 0.0270713794287,<a name="line.620"></a>
+<span class="sourceLineNo">621</span>                regression.getSlopeConfidenceInterval(),1E-8);<a
name="line.621"></a>
+<span class="sourceLineNo">622</span>     }<a name="line.622"></a>
+<span class="sourceLineNo">623</span><a name="line.623"></a>
+<span class="sourceLineNo">624</span><a name="line.624"></a>
+<span class="sourceLineNo">625</span>    // Test remove single observation in
array<a name="line.625"></a>
+<span class="sourceLineNo">626</span>    @Test<a name="line.626"></a>
+<span class="sourceLineNo">627</span>    public void testRemoveSingle() {<a
name="line.627"></a>
+<span class="sourceLineNo">628</span>        // Create regression with inference
data then remove to test<a name="line.628"></a>
+<span class="sourceLineNo">629</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.629"></a>
+<span class="sourceLineNo">630</span>        regression.addData(infData);<a
name="line.630"></a>
+<span class="sourceLineNo">631</span>        regression.removeData(removeSingle);<a
name="line.631"></a>
+<span class="sourceLineNo">632</span>        regression.addData(removeSingle);<a
name="line.632"></a>
+<span class="sourceLineNo">633</span>        // Use the inference assertions
to make sure that everything worked<a name="line.633"></a>
+<span class="sourceLineNo">634</span>        Assert.assertEquals("slope std err",
0.011448491,<a name="line.634"></a>
+<span class="sourceLineNo">635</span>                regression.getSlopeStdErr(),
1E-10);<a name="line.635"></a>
+<span class="sourceLineNo">636</span>        Assert.assertEquals("std err intercept",
0.286036932,<a name="line.636"></a>
+<span class="sourceLineNo">637</span>                regression.getInterceptStdErr(),1E-8);<a
name="line.637"></a>
+<span class="sourceLineNo">638</span>        Assert.assertEquals("significance",
4.596e-07,<a name="line.638"></a>
+<span class="sourceLineNo">639</span>                regression.getSignificance(),1E-8);<a
name="line.639"></a>
+<span class="sourceLineNo">640</span>        Assert.assertEquals("slope conf
interval half-width", 0.0270713794287,<a name="line.640"></a>
+<span class="sourceLineNo">641</span>                regression.getSlopeConfidenceInterval(),1E-8);<a
name="line.641"></a>
+<span class="sourceLineNo">642</span>     }<a name="line.642"></a>
+<span class="sourceLineNo">643</span><a name="line.643"></a>
+<span class="sourceLineNo">644</span>    // Test remove multiple observations<a
name="line.644"></a>
+<span class="sourceLineNo">645</span>    @Test<a name="line.645"></a>
+<span class="sourceLineNo">646</span>    public void testRemoveMultiple() {<a
name="line.646"></a>
+<span class="sourceLineNo">647</span>        // Create regression with inference
data then remove to test<a name="line.647"></a>
+<span class="sourceLineNo">648</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.648"></a>
+<span class="sourceLineNo">649</span>        regression.addData(infData);<a
name="line.649"></a>
+<span class="sourceLineNo">650</span>        regression.removeData(removeMultiple);<a
name="line.650"></a>
+<span class="sourceLineNo">651</span>        regression.addData(removeMultiple);<a
name="line.651"></a>
+<span class="sourceLineNo">652</span>        // Use the inference assertions
to make sure that everything worked<a name="line.652"></a>
+<span class="sourceLineNo">653</span>        Assert.assertEquals("slope std err",
0.011448491,<a name="line.653"></a>
+<span class="sourceLineNo">654</span>                regression.getSlopeStdErr(),
1E-10);<a name="line.654"></a>
+<span class="sourceLineNo">655</span>        Assert.assertEquals("std err intercept",
0.286036932,<a name="line.655"></a>
+<span class="sourceLineNo">656</span>                regression.getInterceptStdErr(),1E-8);<a
name="line.656"></a>
+<span class="sourceLineNo">657</span>        Assert.assertEquals("significance",
4.596e-07,<a name="line.657"></a>
+<span class="sourceLineNo">658</span>                regression.getSignificance(),1E-8);<a
name="line.658"></a>
+<span class="sourceLineNo">659</span>        Assert.assertEquals("slope conf
interval half-width", 0.0270713794287,<a name="line.659"></a>
+<span class="sourceLineNo">660</span>                regression.getSlopeConfidenceInterval(),1E-8);<a
name="line.660"></a>
+<span class="sourceLineNo">661</span>     }<a name="line.661"></a>
+<span class="sourceLineNo">662</span><a name="line.662"></a>
+<span class="sourceLineNo">663</span>    // Remove observation when empty<a
name="line.663"></a>
+<span class="sourceLineNo">664</span>    @Test<a name="line.664"></a>
+<span class="sourceLineNo">665</span>    public void testRemoveObsFromEmpty()
{<a name="line.665"></a>
+<span class="sourceLineNo">666</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.666"></a>
+<span class="sourceLineNo">667</span>        regression.removeData(removeX, removeY);<a
name="line.667"></a>
+<span class="sourceLineNo">668</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.668"></a>
+<span class="sourceLineNo">669</span>    }<a name="line.669"></a>
+<span class="sourceLineNo">670</span><a name="line.670"></a>
+<span class="sourceLineNo">671</span>    // Remove single observation to empty<a
name="line.671"></a>
+<span class="sourceLineNo">672</span>    @Test<a name="line.672"></a>
+<span class="sourceLineNo">673</span>    public void testRemoveObsFromSingle()
{<a name="line.673"></a>
+<span class="sourceLineNo">674</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.674"></a>
+<span class="sourceLineNo">675</span>        regression.addData(removeX, removeY);<a
name="line.675"></a>
+<span class="sourceLineNo">676</span>        regression.removeData(removeX, removeY);<a
name="line.676"></a>
+<span class="sourceLineNo">677</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.677"></a>
+<span class="sourceLineNo">678</span>    }<a name="line.678"></a>
+<span class="sourceLineNo">679</span><a name="line.679"></a>
+<span class="sourceLineNo">680</span>    // Remove multiple observations to empty<a
name="line.680"></a>
+<span class="sourceLineNo">681</span>    @Test<a name="line.681"></a>
+<span class="sourceLineNo">682</span>    public void testRemoveMultipleToEmpty()
{<a name="line.682"></a>
+<span class="sourceLineNo">683</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.683"></a>
+<span class="sourceLineNo">684</span>        regression.addData(removeMultiple);<a
name="line.684"></a>
+<span class="sourceLineNo">685</span>        regression.removeData(removeMultiple);<a
name="line.685"></a>
+<span class="sourceLineNo">686</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.686"></a>
+<span class="sourceLineNo">687</span>    }<a name="line.687"></a>
+<span class="sourceLineNo">688</span><a name="line.688"></a>
+<span class="sourceLineNo">689</span>    // Remove multiple observations past
empty (i.e. size of array &gt; n)<a name="line.689"></a>
+<span class="sourceLineNo">690</span>    @Test<a name="line.690"></a>
+<span class="sourceLineNo">691</span>    public void testRemoveMultiplePastEmpty()
{<a name="line.691"></a>
+<span class="sourceLineNo">692</span>        SimpleRegression regression = new
SimpleRegression();<a name="line.692"></a>
+<span class="sourceLineNo">693</span>        regression.addData(removeX, removeY);<a
name="line.693"></a>
+<span class="sourceLineNo">694</span>        regression.removeData(removeMultiple);<a
name="line.694"></a>
+<span class="sourceLineNo">695</span>        Assert.assertEquals(regression.getN(),
0);<a name="line.695"></a>
+<span class="sourceLineNo">696</span>    }<a name="line.696"></a>
+<span class="sourceLineNo">697</span>}<a name="line.697"></a>
 
 
 



Mime
View raw message