예제 #1
0
def distributed_simulation(epsilon):
    y_star = np.array([[1, 282],
                   [2, 20],
                   [3, 13],
                   [4, 4],
                   [5, 2],
                   [8, 1],
                   [10, 1],
                   [15, 1],
                   [23, 1],
                   [30, 1]], dtype=float)
    dim_theta = 3
    if False:
        N_list = [50,100,200,500,1000]
        batches = 20
    if True:
        N_list = [5]
        batches = 2
    save_file = True
    type_sim = "mc_new"
    # construct the class
    tuberculosis_abc = loop_simulation(simulator, y_star, theta_sampler_mc, delta, epsilon, dim_theta, type_sim)
    # let it run !
    tuberculosis_abc.loop_list_N(N_list,batches,save_file)
    print tuberculosis_abc.mean_theta_list
    print tuberculosis_abc.var_theta_list