mirror of
https://github.com/shizand/statapp.git
synced 2024-12-23 12:12:59 +03:00
parent
86346b9c5b
commit
4854a14e70
@ -3,29 +3,24 @@ import numpy as np
|
|||||||
DIRECT_LINK = 0
|
DIRECT_LINK = 0
|
||||||
INDIRECT_LINK = 1
|
INDIRECT_LINK = 1
|
||||||
|
|
||||||
|
|
||||||
def generate_x_values(mean, std, typeConnection, y):
|
def generate_x_values(mean, std, typeConnection, y):
|
||||||
yMean = np.mean(y)
|
yMean = np.mean(y)
|
||||||
values = []
|
values = []
|
||||||
for cur_y in y:
|
for cur_y in y:
|
||||||
k = np.abs(cur_y / yMean)
|
raz = np.abs(mean - np.random.normal(mean, std))
|
||||||
if k > 1:
|
|
||||||
k = 2 - 1 / k
|
|
||||||
if typeConnection == INDIRECT_LINK:
|
if typeConnection == INDIRECT_LINK:
|
||||||
k = 1 / k
|
raz *= -1
|
||||||
if std == 0:
|
if cur_y > yMean:
|
||||||
k = 1
|
x = mean + raz
|
||||||
|
elif cur_y < yMean:
|
||||||
x = np.random.normal(mean * (k ** 3), std * k)
|
x = mean - raz
|
||||||
|
else:
|
||||||
|
x = mean
|
||||||
values.append(x)
|
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)
|
return np.array(values)
|
||||||
|
|
||||||
|
|
||||||
def variance_analysis(data):
|
def variance_analysis(data):
|
||||||
return np.array([
|
return np.array([
|
||||||
[np.mean(col), np.std(col), np.min(col), np.max(col)] for col in data.T
|
[np.mean(col), np.std(col), np.min(col), np.max(col)] for col in data.T
|
||||||
|
Loading…
Reference in New Issue
Block a user