コード例 #1
0
ファイル: test_smoothing.py プロジェクト: sunpoet/pysal
 def test_standardized_mortality_ratio(self):
     e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
     b = np.array([100, 100, 110, 90, 100, 90, 110, 90])
     s_e = np.array([100, 45, 120, 100, 50, 30, 200, 80])
     s_b = np.array([1000, 900, 1000, 900, 1000, 900, 1000, 900])
     n = 2
     exp_smr = np.array([2.48691099, 2.73684211])
     np.testing.assert_array_almost_equal(exp_smr, sm.standardized_mortality_ratio(e, b, s_e, s_b, n))
コード例 #2
0
 def test_standardized_mortality_ratio(self):
     e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
     b = np.array([100, 100, 110, 90, 100, 90, 110, 90])
     s_e = np.array([100, 45, 120, 100, 50, 30, 200, 80])
     s_b = np.array([1000, 900, 1000, 900, 1000, 900, 1000, 900])
     n = 2
     exp_smr = np.array([2.48691099, 2.73684211])
     np.testing.assert_array_almost_equal(exp_smr,
                                          sm.standardized_mortality_ratio(e, b, s_e, s_b, n))