Esempio n. 1
0
print("\nVariance y = ", var_y)

print("\nEcart type x' : ", ecart_type_x_prime)
print("\nEcart type y : ", ecart_type_y)

print("\nx' = ", mean_x_prime)
print("\ny = ", mean_y)

print("\n Covariance (x',y) :", cov_x_prime_y)

a = cov_x_prime_y / var_x_prime

b = mean_y - a * mean_x_prime

print("\na = ", a)
print("b = ", b)

print(f"\ny = a*lnx+b")
print(f"\ny = {a}*lnx+{b}")

yr = [1, coef_correl_x_prime_y]
xr = [coef_correl_x_prime_y, 1]

dat_set_r = np.array([yr, xr])

D = mt.determinant_recursive(dat_set_r)

R2 = 1 - D

print("R² = ", R2)
Esempio n. 2
0
print("\nMatrice des variances et covariances")

m_y = [var_y, cov_x1_y, cov_x2_y, cov_x3_y]
m_x1 = [cov_x1_y, var_x1, cov_x1_x2, cov_x1_x3]
m_x2 = [cov_x2_y, cov_x1_x2, var_x2, cov_x2_x3]
m_x3 = [cov_x3_y, cov_x1_x3, cov_x2_x3, var_x3]

matrice_r = np.array([m_y, m_x1, m_x2, m_x3])
xx = matrice_r
print(matrice_r)

D = np.delete(matrice_r, 0, 1)
D = np.delete(D, 0, 0)
print("\nD")
print(D)
D = mt.determinant_recursive(D)
print("\nDeterminant D = ", D)

# print("Determiant avec numpy :", np.linalg.det(D))
# the syntax will be M1[row_start:row_end, col_start:col_end]

D1 = np.delete(matrice_r, 1, 1)
D1 = np.delete(D1, 0, 0)
print("\nD1")
print(D1)
D1 = mt.determinant_recursive(D1)
print("\nDeterminant D1 = ", D1)

# m2
print("Matric r m2")
Esempio n. 3
0
print("\nLe coeffiscient de corelation rx1x3 = ", rx1x3)
print("\nLe coeffiscient de corelation rx1x4 = ", rx1x4)
print("\nLe coeffiscient de corelation rx2x3 = ", rx2x3)
print("\nLe coeffiscient de corelation rx2x4 = ", rx2x4)
print("\nLe coeffiscient de corelation rx3x4 = ", rx3x4)

y = [1, ryx1, ryx2, ryx3]
x1 = [ryx1, 1, rx1x2, rx1x3]
x2 = [ryx2, rx1x2, 1, rx2x3]
x3 = [ryx3, rx1x3, rx2x3, 1]

matrice_r = np.array([y, x1, x2, x3])

print(matrice_r)

det_matrice = mt.determinant_recursive(matrice_r)

matrice_mineur = matrice_r[1:, 1:]

print("\nLa matrice mineure : ")
print(matrice_mineur)

det_matrice_mineur = mt.determinant_recursive(matrice_mineur)

print("\nDeterminant D11(matrice mineur) : ", det_matrice_mineur)

D = np.delete(matrice_r, 0, 1)
D = np.delete(D, 0, 0)
print("\nD")
print(D)
D = mt.determinant_recursive(D)