t分布的累积分布函数为:[img]http://upload.wikimedia.org/math/1/7/a/17a31fc1ec3911c61d27007cb99c1910.png[/img]
其中其中:[img]http://upload.wikimedia.org/math/4/6/1/46101ad044b9e9f6c19644e61e7deb7a.png[/img]是超几何函数
结果如下:
[img]http://dl2.iteye.com/upload/attachment/0103/2902/113f54b6-a6ec-3465-a25b-a2304a4f72a8.png[/img]
其中其中:[img]http://upload.wikimedia.org/math/4/6/1/46101ad044b9e9f6c19644e61e7deb7a.png[/img]是超几何函数
set.seed(1000)
x<-seq(-5,5,length.out=1000)
y<-pt(x,1,0)
plot(x,y,col="red",xlim=c(-5,5),ylim=c(0,0.5),type='l',
xaxs="i", yaxs="i",ylab='probility',xlab='',
main="The T Cumulative Distribution Function")
lines(x,pt(x,5,0),col="green")
lines(x,pt(x,5,2),col="blue")
lines(x,pt(x,50,4),col="orange")
legend("topleft",legend=paste("df=",c(1,5,5,50)," ncp=", c(0,0,2,4)), lwd=1, col=c("red", "green","blue","orange"))
结果如下:
[img]http://dl2.iteye.com/upload/attachment/0103/2902/113f54b6-a6ec-3465-a25b-a2304a4f72a8.png[/img]