예제 #1
0
 def compare_with_empyrical(self, dependents, independent):
     INFINITY = 1000000  # close enough
     result = vectorized_beta(
         dependents, independent, allowed_missing=INFINITY,
     )
     expected = np.array([
         empyrical_beta(dependents[:, i].ravel(), independent.ravel())
         for i in range(dependents.shape[1])
     ])
     assert_equal(result, expected, array_decimal=7)
     return result
 def compare_with_empyrical(self, dependents, independent):
     INFINITY = 1000000  # close enough
     result = vectorized_beta(
         dependents, independent, allowed_missing=INFINITY,
     )
     expected = np.array([
         empyrical_beta(dependents[:, i].ravel(), independent.ravel())
         for i in range(dependents.shape[1])
     ])
     assert_equal(result, expected, array_decimal=7)
     return result