R与γ(伽玛)分布(2) 累积分布函数

其累积分布函数为:

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如下:


猜你喜欢

转载自jobar.iteye.com/blog/2156317