예제 #1
0
    def test_assuncao_rate(self):
        e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
        b = np.array([100, 100, 110, 90, 100, 90, 110, 90])

        exp_assuncao_geoda = np.array([ 0.95839273, -0.03783129, -0.51460896, -1.61105841])
        np.testing.assert_array_almost_equal(
            exp_assuncao_geoda, sm.assuncao_rate(e, b)[:4])

        exp_assuncao = np.array([1.03843594, -0.04099089, -0.56250375, -1.73061861])
        np.testing.assert_array_almost_equal(
            exp_assuncao, sm.assuncao_rate(e, b, geoda=False)[:4])
예제 #2
0
    def test_assuncao_rate(self):
        e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
        b = np.array([100, 100, 110, 90, 100, 90, 110, 90])

        exp_assuncao_geoda = np.array(
            [0.95839273, -0.03783129, -0.51460896, -1.61105841])
        np.testing.assert_array_almost_equal(exp_assuncao_geoda,
                                             sm.assuncao_rate(e, b)[:4])

        exp_assuncao = np.array(
            [1.03843594, -0.04099089, -0.56250375, -1.73061861])
        np.testing.assert_array_almost_equal(
            exp_assuncao,
            sm.assuncao_rate(e, b, geoda=False)[:4])
예제 #3
0
 def test_assuncao_rate(self):
     e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
     b = np.array([100, 100, 110, 90, 100, 90, 110, 90])
     exp_assuncao = np.array([1.03843594, -0.04099089, -0.56250375,
         -1.73061861])
     np.testing.assert_array_almost_equal(
         exp_assuncao, sm.assuncao_rate(e, b)[:4])
예제 #4
0
 def test_assuncao_rate(self):
     e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
     b = np.array([100, 100, 110, 90, 100, 90, 110, 90])
     exp_assuncao = np.array(
         [1.04319254, -0.04117865, -0.56539054, -1.73762547])
     np.testing.assert_array_almost_equal(
         exp_assuncao, sm.assuncao_rate(e, b)[:4])
예제 #5
0
파일: moran.py 프로젝트: wangshaohua/pysal
 def __init__(self, e, b, w, adjusted=True, transformation="r", permutations=PERMUTATIONS):
     if adjusted:
         y = assuncao_rate(e, b)
     else:
         y = e * 1.0 / b
     Moran_Local.__init__(self, y, w,
                          transformation=transformation, permutations=permutations)
예제 #6
0
 def test_assuncao_rate(self):
     e = np.array([30, 25, 25, 15, 33, 21, 30, 20])
     b = np.array([100, 100, 110, 90, 100, 90, 110, 90])
     exp_assuncao = np.array(
         [1.03843594, -0.04099089, -0.56250375, -1.73061861])
     np.testing.assert_array_almost_equal(exp_assuncao,
                                          sm.assuncao_rate(e, b)[:4])
예제 #7
0
 def __init__(self, e, b, w, adjusted=True, transformation="r", permutations=PERMUTATIONS):
     if adjusted:
         y = assuncao_rate(e, b)
     else:
         y = e * 1.0 / b
     Moran_Local.__init__(self, y, w,
                          transformation=transformation, permutations=permutations)