Created
October 8, 2019 03:57
-
-
Save kngwyu/25034c9f212a2b2e23bb6aefbe556232 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from matplotlib import pyplot as plt | |
import numpy as np | |
from scipy.stats import beta | |
def plot_beta(a, b): | |
x = np.linspace(beta.ppf(0.01, a, b), beta.ppf(0.99, a, b), 100) | |
plt.plot(x, beta.pdf(x, a, b), 'r-', lw=5, alpha=0.6, label='beta pdf') | |
plt.title('α={} β={}'.format(a, b)) | |
plt.show() | |
if __name__ == '__main__': | |
for a, b in zip([1.0, 10.0, 1.0], [1.0, 1.0, 10.0]): | |
plot_beta(a, b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment