我想在 R 中绘制一个伽马分布,其中比例参数(alpha)保持不变,但卷积参数发生变化(全部在 1 个图中)。我知道 dgamma 但并不真正知道 x 参数的含义。我想通过提供 alpha 和 beta 来绘制函数。这是可行的吗?
您的解决方案的输出是形状 <- c(2,5,6,12)
> plot(dgamma.wrapper, from=0, to=10)
Error in plot(dgamma.wrapper, from = 0, to = 10) :
object 'dgamma.wrapper' not found
> for (i in seq_along(shapes))
+ lines(dgamma(x,shape= shapes[i] , scale = 1) , from=0, to=10, col=i)
Error in dgamma(x, shape = shapes[i], scale = 1) : object 'x' not found
>