diff --git a/scripts/heatmap.py b/scripts/heatmap.py index 40cd3d8bfab16e52d499b1e6732d0636020afeda..1844a8fd3ea567c21e6d9d9f53a1d25fae171bff 100755 --- a/scripts/heatmap.py +++ b/scripts/heatmap.py @@ -141,19 +141,15 @@ def plot_likelyhood(path: str, n_iter: int, task_dur: int, reac: int): overhead2[i] = (t - base) / base * 100.0 i += 1 overhead2.sort() - estimated = scipy.stats.ecdf(overhead2) - x = np.linspace(-5, 100, 10000) - y = estimated.cdf.evaluate(x) - plt.plot(x, y, label="ecdf") - cdf = scipy.stats.norm.cdf(overhead2) - plt.plot(overhead2, cdf, label="cdf") + ecdf = np.linspace(0, 1, len(overhead2)) + plt.plot(overhead2, ecdf, label="ecdf") plt.xlabel("x in %") plt.xlim([-5, 50]) plt.ylabel("P(X < x)") plt.legend() plt.title("Probability than the real overhead is below x") - x_95 = x[bisect_left(y, 0.95)] - x_99 = x[bisect_left(y, 0.99)] + x_95 = overhead2[bisect_left(ecdf, 0.95)] + x_99 = overhead2[bisect_left(ecdf, 0.99)] print(f"P(Overhead < x) < 95% for x = {x_95}") print(f"P(Overhead < x) < 99% for x = {x_99}") plt.show()