-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
29 lines (24 loc) · 940 Bytes
/
Copy pathplot.py
File metadata and controls
29 lines (24 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
# Updated mean and standard deviation for init time
mean_init_time = 2.61
std_init_time = 0.37
# Define the range for plotting the Gaussian distribution
x_range = np.linspace(1, 4, 1000)
y = norm.pdf(x_range, mean_init_time, std_init_time)
# Plotting
plt.figure(figsize=(8, 6))
plt.plot(x_range, y, color='orange', label=f'Mean init time (Mean: {mean_init_time}, SD: {std_init_time})')
plt.fill_between(x_range, y, color='orange', alpha=0.2)
# Calculate 95% confidence interval
conf_int = norm.interval(0.95, loc=mean_init_time, scale=std_init_time)
plt.axvline(conf_int[0], color='red', linestyle='--', label=f'95% CI: [{conf_int[0]:.2f}, {conf_int[1]:.2f}]')
plt.axvline(conf_int[1], color='red', linestyle='--')
# Labels and title
plt.title('Mean init time')
plt.xlabel('Value')
plt.ylabel('Probability Density')
plt.legend()
plt.grid(True)
plt.show()