[Scipy-svn] r4474 - trunk/scipy/stats/tests
scipy-svn at scipy.org
scipy-svn at scipy.org
Tue Jun 24 06:52:40 EDT 2008
Author: cdavid
Date: 2008-06-24 05:52:35 -0500 (Tue, 24 Jun 2008)
New Revision: 4474
Modified:
trunk/scipy/stats/tests/test_stats.py
Log:
Add test for #8.
Modified: trunk/scipy/stats/tests/test_stats.py
===================================================================
--- trunk/scipy/stats/tests/test_stats.py 2008-06-24 08:55:06 UTC (rev 4473)
+++ trunk/scipy/stats/tests/test_stats.py 2008-06-24 10:52:35 UTC (rev 4474)
@@ -482,6 +482,15 @@
assert_almost_equal(intercept,0.0)
assert_almost_equal(r,0.0)
+ def test_regress_simple(self):
+ """Regress a line with sinusoidal noise."""
+ x = numpy.linspace(0, 100, 100)
+ y = 0.2 * numpy.linspace(0, 100, 100) + 10
+ y += numpy.sin(numpy.linspace(0, 20, 100))
+
+ res = stats.linregress(x, y)
+ assert_almost_equal(res[4], 4.3609875083149268e-3)
+
# Utility
def compare_results(res,desired):
More information about the Scipy-svn
mailing list