R与t分布(2) 累积分布函数

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]是超几何函数


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]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值