R - 伽玛累积分布函数

R - Gamma Cumulative Distribution Function

我想计算我拥有的一组数据的 Gamma CDF。我已经计算了 alpha 和 beta 参数,但是我不确定如何在 R 中计算 CDF(是否有类似 Matlab 的 gamcdf 的东西?)。

我看到有些人使用 fitdistrpgamma,但我不明白如何输入 alpha 和 beta 值,或者我根本不需要它们?

谢谢。

gamma 分布由这两个参数定义,给定这两个参数,您可以使用 pgamma 计算值数组的 cdf。

# Let's make a vector
x = seq(0, 3, .01)
# Now define the parameters of your gamma distribution
shape = 1
rate = 2
# Now calculate points on the cdf
cdf = pgamma(x, shape, rate)
# Shown plotted here
plot(x,cdf)

请注意,Gamma 有不同的参数化方式。检查 ?pgamma 以确保您的 2 个参数匹配。