Beispiel #1
0
 def test_cov_2(self):
     "func.cov_2"
     original = larry([[nan, 2.0, 1.0], [2.0, 3.0, 1.0], [4.0, 1.0, 1.0]])
     original = original.demean(1)
     desired = larry(np.ma.cov(np.ma.fix_invalid(original.x), bias=1).data)
     actual = cov(original)
     ale(actual, desired, msg='cov test #2', original=original)
Beispiel #2
0
 def test_cov_1(self):
     "func.cov_1"
     original = larry([[2.0, 2.0, 3.0, 1.0], [3.0, 2.0, 2.0, 1.0],
                       [1.0, 1.0, 1.0, 1.0]])
     original = original.demean(axis=1)
     desired = larry([[0.5, 0.25, 0.], [0.25, 0.5, 0.], [0., 0., 0.]])
     actual = cov(original)
     ale(actual, desired, msg='cov test #1', original=original)
Beispiel #3
0
 def test_cov_2(self):
     "func.cov_2" 
     original = larry([[nan, 2.0, 1.0],
                       [2.0, 3.0, 1.0],
                       [4.0, 1.0, 1.0]])  
     original = original.demean(1)        
     desired = larry(np.ma.cov(np.ma.fix_invalid(original.x), bias=1).data)
     actual = cov(original)
     ale(actual, desired, msg='cov test #2', original=original) 
Beispiel #4
0
 def test_cov_1(self):
     "func.cov_1" 
     original = larry([[ 2.0, 2.0, 3.0, 1.0],
                       [ 3.0, 2.0, 2.0, 1.0],
                       [ 1.0, 1.0, 1.0, 1.0]])
     original = original.demean(axis=1)      
     desired = larry([[ 0.5,   0.25,  0.  ],
                      [ 0.25,  0.5,   0.  ],
                      [ 0.,    0.,    0.  ]])     
     actual = cov(original)
     ale(actual, desired, msg='cov test #1', original=original)