Skip to content

Commit 34b382f

Browse files
authored
Merge pull request #8 from aryankhandal0/master
Update how-is-this-parameter-optimal.py
2 parents 18757e2 + 3c9f5e5 commit 34b382f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

07-statistical-thinking-in-python-(part-2)/1-parameter-estimation-by-optimization/how-is-this-parameter-optimal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
plt.ylabel('CDF')
5757

5858
# Take samples with half tau: samples_half
59-
samples_half = ____
59+
samples_half = np.random.exponential(tau/2,10000)
6060

6161
# Take samples with double tau: samples_double
62-
samples_double = ____
62+
samples_double = np.random.exponential(tau*2,10000)
6363

6464
# Generate CDFs from these samples
65-
x_half, y_half = ____
66-
x_double, y_double = ____
65+
x_half, y_half = ecdf(samples_half)
66+
x_double, y_double = ecdf(samples_double)
6767

6868
# Plot these CDFs as lines
6969
_ = plt.plot(x_half, y_half)
7070
_ = plt.plot(x_double, y_double)
7171

7272
# Show the plot
73-
plt.show()
73+
plt.show()

0 commit comments

Comments
 (0)