Esempio n. 1
0
    return new_list[int(len(new_list) / 2)]

def intervalle_de_confiance_moyenne(nb_sigma_precision, ecart_type, taille, moyenne):
    a = dico_sigma[nb_sigma_precision][0] * ecart_type / sqrt(taille)
    return (moyenne - a, moyenne +a)

def intervalle_de_confiance_mediane(nb_sigma_precision, list):
    n = len(list)
    j = int((n / 2) - dico_sigma[nb_sigma_precision][0] * sqrt(n) / 2)
    k = int((n / 2) + dico_sigma[nb_sigma_precision][0] * sqrt(n) / 2)
    # il faut ordonner la liste
    listeTriee = sorted(list)
    xj = listeTriee[j]
    xk = listeTriee[k]
    return (xj, xk)

if __name__ == "__main__":

    import simul_exercice1 as s1
    import moyenne_pareto as mp
    import simul_exercice2 as s2


    # initialisation des générateurs de nombres aléatoires
    seed(1)
    np.random.seed(1)

#    s1.do(40, 60, -1, 100000, 0.1, 1)
#    mp.do(1.25, 2)
    s2.do(30, 35, -1, 100000, 1.25, 2, 1)
Esempio n. 2
0
import sys
import simul_exercice1 as s1
import simul_exercice2 as s2
from random import *
import numpy as np

if __name__ == "__main__":

    seed(1)
    np.random.seed(1)

    if len(sys.argv) != 0:

        num_graph = int(sys.argv[1])
        if num_graph == 1: # Exercice 1, 3.1
            s1.do(24, 25, 26, 80000, 0.1, 1)
        elif num_graph == 2: # Exercice 1, 3.2
            s1.do(20, 30, -1, 10000, 0.1, 1)
        elif num_graph == 3: # Exercice 2, 2.1
            s2.do(24, 25, 26, 40000, 1.25, 2, 1)
        elif num_graph == 4: # Exercice 2, 2.2
            s2.do(20, 30, -1, 40000, 1.25, 2, 1)
            print "out"
        elif num_graph == 5:
            print "out"
        elif num_graph == 6:
            print "out"
        else:
            print "out"