Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这可能是一个非常愚蠢的问题,但有谁知道为什么我没有得到第二位等于平均值(100)?
#beta=4, alpha=5, mean=20 qgamma(0.5, 5, 1/4) # 18.68364 #beta=2500, alpha=0.04, mean=100 qgamma(0.5,0.04,1/2500) # 0.00004320412
这是因为您使用的是分位数函数,并且qgamma(0.5, shape, scale)对应于中位数 - 而不是您期望的平均值。
qgamma(0.5, shape, scale)
请参见下面的示例;
x <- rgamma(50000, shape = 0.04, scale = 2500) mean(x) # [1] 98.82911 median(x) # [1] 3.700012e-05