예제 #1
0
파일: test_cov.py 프로젝트: SX-Aurora/nlcpy
def test_me_case_2():
    np_a = np.array([-2.1, -1, 4.3])
    ny_a = ny.array([-2.1, -1, 4.3])

    ans_np = np.cov(np_a)
    ans_ny = ny.cov(ny_a)

    print("numpy={} nlcpy={}".format(ans_np, ans_ny))
    assert_array_almost_equal(ans_np, ans_ny.get())
예제 #2
0
파일: test_cov.py 프로젝트: SX-Aurora/nlcpy
def testt_me_case_13():
    np_a = np.array([[10, 5, 2, 4, 9, 3, 2], [10, 2, 8, 3, 7, 4, 1]])
    ny_a = ny.array([[10, 5, 2, 4, 9, 3, 2], [10, 2, 8, 3, 7, 4, 1]])

    ans_np = np.cov(np_a, aweights=None)
    ans_ny = ny.cov(ny_a, aweights=None)

    print("numpy={} nlcpy={}".format(ans_np, ans_ny))
    assert_array_almost_equal(ans_np, ans_ny.get())
예제 #3
0
파일: test_cov.py 프로젝트: SX-Aurora/nlcpy
def test_me_case_5():
    np_a = np.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])
    ny_a = ny.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])

    ans_np = np.cov(np_a.T, rowvar=True)
    ans_ny = ny.cov(ny_a.T, rowvar=True)

    print("numpy={} nlcpy={}".format(ans_np, ans_ny))
    assert_array_almost_equal(ans_np, ans_ny.get())
예제 #4
0
파일: test_cov.py 프로젝트: SX-Aurora/nlcpy
def test_me_case_3():
    np_a = np.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])
    ny_a = ny.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])
    np_y = np.array([2, 1, 1, 8, 9, 4, 3, 5, 7])
    ny_y = ny.array([2, 1, 1, 8, 9, 4, 3, 5, 7])

    ans_np = np.cov(np_a, np_y)
    ans_ny = ny.cov(ny_a, ny_y)

    print("numpy={} nlcpy={}".format(ans_np, ans_ny))
    assert_array_almost_equal(ans_np, ans_ny.get())