Help us understand the problem. What is going on with this article?

# Pythonで確率分布

More than 1 year has passed since last update.

StanとRでベイズ統計モデリング Chapter 6 から

# Gamma Distribution

$Gamma(y|\alpha,\beta) = \frac{\beta^{\alpha}}{\Gamma(\alpha)} y^{\alpha-1} exp(-\beta y)$
$\frac{\beta^{\alpha}}{\Gamma(\alpha)}$ 積分を１にするための正規化定数
$y$: 正の実数
$\alpha, \beta$: 正の実数 $\alpha$ Shape パラメータ、$\beta$ rate パラメータ
$E(y) = \alpha / \beta$
$V(y) = \sqrt{\alpha} / \beta$

plt.figure(figsize=(10,5))

k = [1,3,3]
theta = [1,3,1]

x = np.linspace(0,6,100)

for i in zip(k,theta):
rv = gamma(a=i[0], scale=1/i[1])
y = rv.pdf(x)
plt.plot(x, y, label=u'$α={0:.1f}, β={1:.1f}$'.format(i[0],i[1]))

plt.xlim(0,6)
plt.grid()
plt.xlabel("y")
plt.ylabel("density")

plt.legend(fontsize='small')
plt.title("Gamma")
plt.xlabel("y")
plt.ylabel("density")



Why do not you register as a user and use Qiita more conveniently?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away