def test_CT20(): xk = 1119 slope = mmm.calculate_slope(numbers) const = mmm.calculate_const(numbers, slope) variance = mmm.calculate_variance_with_regression(numbers, slope, const) std_dev = mmm.std_derivation(variance) student_val = 1.860 assert mmm.calculate_interval(xk, numbers, std_dev, student_val) < 439.5455325
def tp1(): """ Fonction pour le tp1 """ numbers = mr.read_csv_data("test_tp1.csv") mean = mmm.mean(numbers) variance = mmm.variance(numbers, mean) std_der = mmm.std_derivation(variance) print("moyenne: {:10.2f}".format(mean)) print("variance: \t{:10.2f}".format(variance)) print("ecart-type: {:7.2f}".format(std_der))
def tp5(): """ Fonction pour le tp5 """ numbers = mr.read_csv_data("test_tp5.csv") xk = float( mr.get_user_input( "Quelle valeur voulez-vous chercher l'intervalle de confiance?")) slope = mmm.calculate_slope(numbers) const = mmm.calculate_const(numbers, slope) variance = mmm.calculate_variance_with_regression(numbers, slope, const) std_dev = mmm.std_derivation(variance) student_val = mmm.get_student_with_alpha() interval = mmm.calculate_interval(xk, numbers, std_dev, student_val) yk = const + xk * slope bounds = mmm.calculate_bounds_interval(interval, yk) print("Intevalle = {:0.6f}".format(interval)) print("Limite supérieure = {:0.6f}".format(bounds[0])) print("Limite inférieure = {:0.6f}".format(bounds[1]))
def test_CT4(): numbers = [186, 699, 132, 272, 291, 331, 199, 1890, 788, 1601] mean = mmm.mean(numbers) var = mmm.variance(numbers, mean) assert mmm.std_derivation(var) > 625