def test_Empirical_Bayes_tabular(self): out_eb = sm.Empirical_Bayes(self.df[self.ename], self.df[self.bname]).r np.testing.assert_allclose(out_eb[:5].flatten(), self.eb, rtol=RTOL, atol=ATOL) self.assertIsInstance(out_eb, np.ndarray) out_eb = sm.Empirical_Bayes.by_col(self.df, self.ename, self.bname) outcol = '{}-{}_empirical_bayes'.format(self.ename, self.bname) outcol = out_eb[outcol] np.testing.assert_allclose(outcol[:5], self.eb, rtol=RTOL, atol=ATOL) self.assertIsInstance(outcol.values, np.ndarray)
def test_Empirical_Bayes(self): out_eb = sm.Empirical_Bayes(self.e, self.b).r out_eb = [round(i, 7) for i in out_eb[:5]] self.assertEquals(out_eb, self.eb)
def test_Empirical_Bayes(self): out_eb = sm.Empirical_Bayes(self.e, self.b).r np.testing.assert_allclose(out_eb[:5].flatten(), self.eb, rtol=RTOL, atol=ATOL)