R - Gamma累积分布函数

Ann*_*n M 2 statistics r gamma-distribution cdf

我想为我拥有的数据数组计算Gamma CDF.我已经计算了alpha和beta参数,但是我不知道如何计算R中的CDF,(有没有类似Matlab的gamcdf?).

我见过一些人使用过fitdistr,或者pgamma,但我不明白如何设置alpha和beta值,或者我根本不需要它们?

谢谢.

evo*_*obe 6

伽玛分布由两个参数定义,给定这两个参数,您可以使用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)
Run Code Online (Sandbox Code Playgroud)

Gamma CDF

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