diff --git a/statapp/calculations.py b/statapp/calculations.py index d06abd1..208eae9 100644 --- a/statapp/calculations.py +++ b/statapp/calculations.py @@ -3,30 +3,25 @@ import numpy as np DIRECT_LINK = 0 INDIRECT_LINK = 1 + def generate_x_values(mean, std, typeConnection, y): yMean = np.mean(y) values = [] for cur_y in y: - k = np.abs(cur_y / yMean) - if k > 1: - k = 2 - 1 / k + raz = np.abs(mean - np.random.normal(mean, std)) if typeConnection == INDIRECT_LINK: - k = 1 / k - if std == 0: - k = 1 - - x = np.random.normal(mean * (k ** 3), std * k) + raz *= -1 + if cur_y > yMean: + x = mean + raz + elif cur_y < yMean: + x = mean - raz + else: + x = mean values.append(x) - # if (x > gfw.mat and cur_y > yMat) or (x < gfw.mat and cur_y < yMat): - # dd = np.append(dd, 1) - # else: - # dd = np.append(dd, 0) - - # x_arr = x_arr.reshape(len(x_arr), 1) - return np.array(values) + def variance_analysis(data): return np.array([ [np.mean(col), np.std(col), np.min(col), np.max(col)] for col in data.T - ]) + ]) \ No newline at end of file