~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/sandbox/models/tests/test_rlm.py

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Test functions for models.rlm
 
3
"""
 
4
 
 
5
import numpy.random as R
 
6
from numpy.testing import NumpyTest, NumpyTestCase
 
7
 
 
8
import scipy.sandbox.models.rlm as models
 
9
 
 
10
W = R.standard_normal
 
11
 
 
12
class test_Regression(NumpyTestCase):
 
13
 
 
14
    def test_Robust(self):
 
15
        X = W((40,10))
 
16
        Y = W((40,))
 
17
        model = models(design=X)
 
18
        results = model.fit(Y)
 
19
        self.assertEquals(results.df_resid, 30)
 
20
 
 
21
    def test_Robustdegenerate(self):
 
22
        X = W((40,10))
 
23
        X[:,0] = X[:,1] + X[:,2]
 
24
        Y = W((40,))
 
25
        model = models(design=X)
 
26
        results = model.fit(Y)
 
27
        self.assertEquals(results.df_resid, 31)
 
28
 
 
29
if __name__ == "__main__":
 
30
    NumpyTest().run()