R与正态分布(2) 累积分布函数

累积分布函数为:



set.seed(0)
x <- seq(-5,5,length.out=100)
y <- pnorm(x,0,1)
plot(x,y,col="red",xlim=c(-5,5),ylim=c(0,1),type='l',xaxs="i", yaxs="i",ylab='density',xlab='',main="The Normal Cumulative Distribution")
lines(x,pnorm(x,0,0.5),col="green")
lines(x,pnorm(x,0,2),col="blue")
lines(x,pnorm(x,-2,1),col="orange")
legend("bottomright",legend=paste("m=",c(0,0,0,-2)," sd=", c(1,0.5,2,1)), lwd=1,col=c("red", "green","blue","orange"))



如下图所示:

R与正态分布(2) 累积分布函数

你可能感兴趣的:(函数)