资源描述:
《常用连续型概率分布》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、常用连续型概率分布概率密度函数图及R语言实现作者:张丹(@Conan_Z)Email:bsspirit@gmail.comWebsite:http://www.fens.me日期:2012-11-26正态分布n=100x<-seq(-5,5,length.out=n)plot(x,dnorm(x,0,1),col="red",xlim=c(-5,5),ylim=c(0,1),type='l',xaxs="i",yaxs="i",ylab='density',xlab='',main="TheNormalDensityDistribution")lines
2、(x,dnorm(x,0,0.5),col="green")lines(x,dnorm(x,0,2),col="blue")lines(x,dnorm(x,-2,1),col="orange")legend("topright",legend=paste("m=",c(0,0,0,-2),"sd=",c(1,0.5,2,1)),lwd=1,col=c("red","green","blue","orange"))指数分步n=100x<-seq(-1,2,length.out=n)plot(x,dexp(x,0.5),col="red",xlim=c(0,
3、2),ylim=c(0,5),type='l',xaxs="i",yaxs="i",ylab='density',xlab='',main="TheExponentialDensityDistribution")lines(x,dexp(x,1),col="green")lines(x,dexp(x,2),col="blue")lines(x,dexp(x,5),col="orange")legend("topright",legend=paste("rate=",c(.5,1,2,5)),lwd=1,col=c("red","green","blue"
4、,"orange"))γ(伽玛)分布n=100x<-seq(0,10,length.out=n)plot(x,dgamma(x,1,2),col="red",xlim=c(0,10),ylim=c(0,2),type='l',xaxs="i",yaxs="i",ylab='density',xlab='',main="TheGammaDensityDistribution")lines(x,dgamma(x,2,2),col="green")lines(x,dgamma(x,3,2),col="blue")lines(x,dgamma(x,5,1),co
5、l="orange")lines(x,dgamma(x,9,1),col="black")legend("topright",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"))weibull分布x<-seq(0,2.5,length.out=1000)plot(x,dweibull(x,.5),type="l",col="blue",xlim=c(0,2.5),ylim=c(0,2.5),x
6、axs="i",yaxs="i",ylab='density',xlab='',main="TheWeibullDensityDistribution")lines(x,dweibull(x,1),type="l",col="red")lines(x,dweibull(x,1.5),type="l",col="magenta")lines(x,dweibull(x,5),type="l",col="green")legend("topright",legend=paste("shape=",c(.5,1,1.5,5)),lwd=1,col=c("blue
7、","red","magenta","green"))F分布n=100x<-seq(-5,5,length.out=n)plot(x,df(x,1,1,0),col="red",xlim=c(-2,2),ylim=c(-10,2),type='l',xaxs="i",yaxs="i",ylab='density',xlab='',main="TheFDensityDistribution")lines(x,df(x,1,1,2),col="green")lines(x,dt(x,2,2,2),col="blue")lines(x,dt(x,2,4,2),
8、col="orange")legend("bottomright",legend