diff --git a/notebooks/fig1.png b/notebooks/fig1.png deleted file mode 100644 index 40aea21..0000000 Binary files a/notebooks/fig1.png and /dev/null differ diff --git a/notebooks/fig1.svg b/notebooks/fig1.svg deleted file mode 100644 index a31a326..0000000 --- a/notebooks/fig1.svg +++ /dev/null @@ -1,23275 +0,0 @@ - - - - - - - - 2023-03-15T18:14:16.784620 - image/svg+xml - - - Matplotlib v3.7.0, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/notebooks/rmax-n.py b/notebooks/rmax-n.py new file mode 100644 index 0000000..b7b95ad --- /dev/null +++ b/notebooks/rmax-n.py @@ -0,0 +1,30 @@ +import numpy as np +import matplotlib.pyplot as plt +import scipy + +from notebooks.lib import read_load + + +def linear(x, a, b): + return x * a + b + + +alpha = read_load("../data/alpha") +meaned_by_N = alpha.groupby('N').agg({'fd': ['mean', 'std']}) \ + .reset_index() \ + .replace([np.inf, -np.inf], np.nan) + +without_prefix = alpha[alpha.N > 50] + +p, pcov = scipy.optimize.curve_fit(linear, np.log(without_prefix.cr), np.log(without_prefix.N)) +linear_extent = np.linspace(0, np.max(np.log(alpha.cr))) + +plt.scatter(np.log(alpha.cr), np.log(alpha.N), s=1, marker='.', color="tab:blue") +plt.plot(linear_extent, linear(linear_extent, *p), color="tab:red") + +plt.xlabel("$\\log r_{max}$") +plt.ylabel("$\\log N$") + +plt.savefig('../figures/rmax-n.svg') +plt.savefig('../figures/rmax-n.png') +plt.show() diff --git a/notebooks/sp-fd.py b/notebooks/sp-fd.py new file mode 100644 index 0000000..12f2907 --- /dev/null +++ b/notebooks/sp-fd.py @@ -0,0 +1,30 @@ +import numpy as np +from matplotlib import pyplot as plt + +from notebooks.lib import read_sp + +c_sp = read_sp("../data/stick-probability") +by_run = c_sp.groupby(['probability', 'N']) + +by_probability = by_run.agg( + overall_fd=('fd', lambda fd: np.mean(fd[-100:])), + overall_fd_std=('fd', 'std') +).reset_index().groupby('probability') + +ggg = by_probability.agg( + fd=('overall_fd', 'mean'), + # TODO Check stats + fd_std=('overall_fd_std', lambda std: np.sqrt(np.mean(np.square(std)))) +) + +plt.fill_between(ggg.index, ggg.fd - ggg.fd_std, ggg.fd + ggg.fd_std, alpha=0.2, label=f"Standard error band") +plt.plot(ggg.index, ggg.fd, color='tab:blue', label='fd mean, seeds = 100') +plt.plot(ggg.index, ggg.fd) + +plt.xlabel("$p_{stick}$") +plt.ylabel("$fd$") +plt.legend() + +plt.savefig('../figures/sp-fd.svg') +plt.savefig('../figures/sp-fd.png') +plt.show()