其累积分布函数为:[img]http://upload.wikimedia.org/math/c/d/a/cda64db5cca2f009140347d225203ec1.png[/img]
plot如下:
[img]http://dl2.iteye.com/upload/attachment/0103/1934/8f3a68b3-c272-35cb-be04-c11c46b68ee3.png[/img]
set.seed(1000)
x<-seq(0,10,length.out=100)
y<-pgamma(x,1,2)
plot(x,y,col="red",xlim=c(0,10),ylim=c(0,1),type='l',
xaxs="i", yaxs="i",ylab='density',xlab='',
main="The Gamma Cumulative Distribution Function")
lines(x,pgamma(x,2,2),col="green")
lines(x,pgamma(x,3,2),col="blue")
lines(x,pgamma(x,5,1),col="orange")
lines(x,pgamma(x,9,1),col="black")
legend("bottomright",legend=paste("shape=",c(1,2,3,5,9)," rate=", c(2,2,2,1,1)), lwd=1, col=c("red", "green","blue","orange","black"))
plot如下:
[img]http://dl2.iteye.com/upload/attachment/0103/1934/8f3a68b3-c272-35cb-be04-c11c46b68ee3.png[/img]