import numpy as np from cans2.process import read_in_json from cans2.plotter import plot_scatter results_dir = "results/local_min_sims/" data_path = results_dir + "sim_0_b_index_5_uniform.json" data = read_in_json(data_path) no_cultures = data["rows"]*data["cols"] x = data["sim_params"][-no_cultures:] y = data["est_params"][-no_cultures:] title = "b correlation (Gaussian simulated)" xlab = "True b" ylab = "Estimated b" outfile = results_dir + "plots/est_v_true/uniform_sim_0.pdf" plot_scatter(x, y, title, xlab, ylab, outfile)
import numpy as np from cans2.process import read_in_json filename = "data/local_min_sims/sim_{0}.json" sim_params = [read_in_json(filename.format(i))["sim_params"] for i in range(5)] sim_params = np.array(sim_params) N_0 = sim_params[:, 1] NE_0 = sim_params[:, 2] print(["sim_{0}".format(i) for i in np.arange(5)]) print("N_0", N_0) print("NE_0", NE_0) print("NE_0/N_0", NE_0 / N_0)