现在的位置: 首页 > 综合 > 正文

一个Statistical Computing主页

2018年02月19日 ⁄ 综合 ⁄ 共 486字 ⁄ 字号 评论关闭

#Plotting in preparation for the ImpSamp function.  Suggests ideal g* would be an unusual distribution

x=seq(-3,3,by=.1)
gx=sqrt(abs(x/(1-x)))*dt(x,5)

plot(x,gx,type="l")
lines(x,dt(x,5),lty=2,col="red")
lines(x,sqrt(abs(x/(1-x)))/5,lty=3,col="green")
legend(-2,.6,c("h(x)*f(x)","f(x)","Scaled h(x)"),col=c("black","red","green"),lty=c(1,2,3))

上面的小例子是作重要性抽样的R代码,代码摘自:http://www.stat.sc.edu/~grego/courses/stat740/。这个网页上还有很多关于统计计算的资源。作此记录一来是感慨下网络资源的丰富,二来对比一下国内教学网络资源的匮乏。期望国内的网络资源快点丰富起来,大学教授也能将工作成绩挂在网上供大家学习探讨。

抱歉!评论已关闭.