*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 932e8fc5 authored by Patrick Kappl's avatar Patrick Kappl
Browse files

Add function for plotting average bias correction

parent a102ddb6
No related branches found
No related tags found
No related merge requests found
......@@ -365,18 +365,33 @@ def plot_bias_correction(k=[[0, 0]], file_indexes=[0], i_channel=None,
return
def plot_one_over_n():
# TODO: Make it beautiful
averages = []
k_x = 0
k_y = k_x
for i_file in range(len(file_names)):
def plot_average_bias_correction(file_indexes=[0], i_channel=None,
fig_name=None):
average_corrections = []
for i_file in file_indexes:
if i_channel is None:
bias_correction = np.abs(np.imag(
transformed_input_means[i_file, k_x, k_y, :]
- means[i_file, k_x, k_y, :]))
averages.append(np.mean(bias_correction))
plt.plot(1/np.array([2, 4, 8, 16]), averages, "x-")
transformed_input_means[i_file, :, :, :]
- means[i_file, :, :, :]))
else:
bias_correction = np.abs(np.real(
transformed_input_means[i_file, i_channel, :, :, :]
- means[i_file, i_channel, :, :, :]))
average_corrections.append(np.mean(bias_correction))
ax = plt.gca()
ax.yaxis.set_major_formatter(mtick.FormatStrFormatter("%.2e"))
ax.tick_params(axis="x", which="minor", bottom=False)
plt.title("Average bias correction over all $\\nu$ and $k$")
plt.loglog(n_worm_samples[file_indexes], average_corrections, "x-")
plt.xticks(n_worm_samples[file_indexes], [str(n) for n in n_worm_samples])
plt.xlabel("n_worm_samples")
plt.ylabel(r"$|f(\hat{x})-\hat{y}_{\mathrm{jackknife}}|$", fontsize=12)
plt.grid(which="major")
if fig_name is None:
plt.show()
else:
plt.savefig(fig_name, dpi=200, bbox_inches="tight")
return
def plot_sigma0():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment