data_set_x1 = [ 2310, 2333, 2356, 2379, 2402, 2425, 2448, 2471, 2494, 2517, 2540 ] data_set_x2 = [2, 2, 3, 3, 2, 4, 2, 2, 3, 4, 2] data_set_x3 = [2, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3] data_set_x4 = [20, 12, 33, 43, 53, 23, 99, 34, 23, 55, 22] # data_set_x = [138.08,100.37, 37.52, 34.9, 204.4, 95, 38] data_set_y = [ 142000, 144000, 151000, 150000, 139000, 169000, 126000, 142900, 163000, 169000, 149000 ] # data_set_y = [73.13,56.56, 21.48,16.81,115.56,53.7,20.15] arth_mean_x1 = mt.art_mean(data_set_x1) arth_mean_x2 = mt.art_mean(data_set_x2) arth_mean_x3 = mt.art_mean(data_set_x3) arth_mean_x4 = mt.art_mean(data_set_x4) arth_mean_y = mt.art_mean(data_set_y) # geo_mean_x = mt.geo_mean(data_set_x) # geo_mean_y = mt.geo_mean(data_set_y) sum_x1_pow_2 = mt.sum_list_square(data_set_x1) sum_x2_pow_2 = mt.sum_list_square(data_set_x2) sum_x3_pow_2 = mt.sum_list_square(data_set_x3) sum_x3_pow_4 = mt.sum_list_square(data_set_x4) sum_y_pow_2 = mt.sum_list_square(data_set_y) sum_x1 = mt.sum_list(data_set_x1)
""" x = data_set[:, 0] y = data_set[:, 1] """ Plot your data """ plt.plot(x, y, 'ro', label="Original Data") """ brutal force to avoid errors """ x = np.array(x, dtype=float) #transform your data in a numpy array of floats y = np.array(y, dtype=float) #so the curve_fit can work var_x = mt.variance_list(x) mean_x = mt.art_mean(x) list_ln_y = mt.ln_list(y) var_y_prime = mt.variance_list(list_ln_y) ecart_type_y_prime = sqrt(var_y_prime) ecart_type_x = sqrt(var_x) mean_y_prime = mt.art_mean(list_ln_y) cov_x_y_prime = mt.covariance_list1_list2(x, list_ln_y) coef_correl_x_y_prime = cov_x_y_prime / (ecart_type_x * ecart_type_y_prime) print("\nMoyenne x : ", mean_x)
Generate some data, let's imagine that you already have this. """ x = data_set[:, 0] y = data_set[:, 1] """ Plot your data """ plt.plot(x, y, 'ro', label="Original Data") """ brutal force to avoid errors """ x = np.array(x, dtype=float) #transform your data in a numpy array of floats y = np.array(y, dtype=float) #so the curve_fit can work var_y = mt.variance_list(y) mean_y = mt.art_mean(y) ecart_type_y = sqrt(var_y) list_ln_x = mt.ln_list(x) var_x_prime = mt.variance_list(list_ln_x) ecart_type_x_prime = sqrt(var_x_prime) mean_x_prime = mt.art_mean(list_ln_x) cov_x_prime_y = mt.covariance_list1_list2(list_ln_x, y) coef_correl_x_prime_y = cov_x_prime_y / (ecart_type_x_prime * ecart_type_y) print("\nVariance x' = ", var_x_prime) print("\nVariance y = ", var_y) print("\nEcart type x' : ", ecart_type_x_prime)
""" Plot your data """ plt.plot(x, y, 'ro',label="Original Data") """ brutal force to avoid errors """ data_set_x1 = np.array(x, dtype=float) #transform your data in a numpy array of floats data_set_y = np.array(y, dtype=float) #so the curve_fit can work arth_mean_x1 = mt.art_mean(data_set_x1) arth_mean_y = mt.art_mean(data_set_y) # geo_mean_x = mt.geo_mean(data_set_x) # geo_mean_y = mt.geo_mean(data_set_y) sum_x1_pow_2 = mt.sum_list_square(data_set_x1) sum_y_pow_2 = mt.sum_list_square(data_set_y) sum_x1 = mt.sum_list(data_set_x1) sum_y = mt.sum_list(data_set_y) sum_x1_y = mt.sum_list1_dot_list2(data_set_x1,data_set_y)