0
我想繪製alpha = 29(scale)和beta = 3(大小)的gamma分佈。換句話說,我想繪製Gamma(29,3)的pdf。如果根據documentation,我如何做到這一點,python gamma函數只有參數a和x,並且size參數不存在?如何繪製python中的alpha和beta參數的gamma分佈
我以爲loc
是測試版,但我認爲它實際上抵消,所以下面的代碼是錯誤的...
import numpy as np
import scipy.stats as stats
from matplotlib import pyplot as plt
x = np.linspace (0, 100, 200)
y1 = stats.gamma.pdf(x, a=29, loc=3) #a is alpha, loc is beta???
plt.plot(x, y1, "y-", label=(r'$\alpha=29, \beta=3$'))
plt.ylim([0,0.08])
plt.xlim([0,150])
plt.show()