PySDM_examples.Shima_et_al_2009.error_measure

 1import numpy as np
 2
 3
 4def error_measure(y, y_true, x):
 5    errors = y_true - y
 6    errors = errors[0:-1] + errors[1:]
 7    dx = np.diff(x)
 8    errors *= dx
 9    errors /= 2
10    error = np.sum(np.abs(errors))
11    return error
def error_measure(y, y_true, x):
 5def error_measure(y, y_true, x):
 6    errors = y_true - y
 7    errors = errors[0:-1] + errors[1:]
 8    dx = np.diff(x)
 9    errors *= dx
10    errors /= 2
11    error = np.sum(np.abs(errors))
12    return error