Created
June 29, 2018 09:38
-
-
Save sdia-zz/dc3378f138cd0f4db84722a1881770c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import numpy as np | |
import scipy.stats as stats | |
from IPython.core.pylabtools import figsize | |
import matplotlib.pyplot as plt | |
figsize(12.5, 5) | |
params = [(2, 5), (1, 1), (0.5, 0.5), (5, 5), (20, 4), (5, 1)] | |
x = np.linspace(0.01, .99, 100) | |
beta = stats.beta | |
for a, b in params: | |
y = beta.pdf(x, a, b) | |
lines = plt.plot(x, y, label = "(%.1f,%.1f)"%(a,b), lw = 3) | |
plt.fill_between(x, 0, y, alpha = 0.2, color = lines[0].get_color()) | |
plt.autoscale(tight=True) | |
plt.ylim(0) | |
plt.legend(loc = 'upper left', title="(a,b)-parameters"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment