Пример #1
0
def test_wald():
    data = np.load("../examples/data/wald_test_ts.npy").item()

    x = data['x']
    y = data['y']

    w, r, e, we = wald(x, y)
    np.testing.assert_almost_equal(w, -6.07394435273)
Пример #2
0
import numpy as np
np.set_printoptions(precision=3, linewidth=256)

from dyfunconn.ts import wald

import matplotlib.pyplot as plt

if __name__ == "__main__":
    data = np.load("../examples/data/wald_test_ts.npy").item()
    x = data['x']
    y = data['y']

    print(np.shape(x))

    # Test
    w, r, e, we = wald(x, y)

    print(w)

    # Plot
    e = e - 1

    data = np.vstack((x, y))

    n_range = np.max(we) - np.min(we)
    we = (we - np.min(we) / n_range)

    plt.figure()
    for i in range(len(e)):
        x1, y1 = data[e[i, 0], 0], data[e[i, 1], 0]
        x2, y2 = data[e[i, 0], 1], data[e[i, 1], 1]