Last active
August 29, 2015 14:07
-
-
Save amacbee/10f08d4a10102bc4b8a2 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
# -*- coding: utf-8 -*- | |
import matplotlib | |
colors = matplotlib.rcParams['axes.color_cycle'] | |
from matplotlib import pyplot as plt | |
from scipy.stats import beta | |
import numpy as np | |
x = np.linspace(0,1, num=200) | |
for a, b, c in zip([0.5, 0.5, 1, 2, 3], [0.5, 1, 3, 2, 5], colors): | |
plt.plot(x, beta.pdf(x, a, b), lw=2, | |
c=c, label=r"$\alpha = {0:.1f},\ \beta={1:.1f}$".format(a, b)) | |
plt.legend(loc=0) | |
plt.ylabel("$pdf$") | |
plt.xlabel("$x$") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment