Exemplo n.º 1
0
 def test_Excess_Risk_tabular(self):
     out_er = sm.Excess_Risk(self.df[self.ename], self.df[self.bname]).r
     np.testing.assert_allclose(out_er[:5].flatten(),
                                self.er,
                                rtol=RTOL,
                                atol=ATOL)
     self.assertIsInstance(out_er, np.ndarray)
     out_er = sm.Excess_Risk.by_col(self.df, self.ename, self.bname)
     outcol = '{}-{}_excess_risk'.format(self.ename, self.bname)
     outcol = out_er[outcol]
     np.testing.assert_allclose(outcol[:5], self.er, rtol=RTOL, atol=ATOL)
     self.assertIsInstance(outcol.values, np.ndarray)
Exemplo n.º 2
0
 def test_Excess_Risk(self):
     out_er = sm.Excess_Risk(self.e, self.b).r
     out_er = [round(i, 5) for i in out_er[:5]]
     self.assertEquals(out_er, self.er)
Exemplo n.º 3
0
 def test_Excess_Risk(self):
     out_er = sm.Excess_Risk(self.e, self.b).r
     np.testing.assert_allclose(out_er[:5].flatten(),
                                self.er,
                                rtol=RTOL,
                                atol=ATOL)