打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
强大数定律和弱大数定律的图示

大数定律和弱大数定律的图示

DataRMatlab 2017-05-03 17:47:39
In the following we're talking about a simple random walk, $X_i=\pm 1$ with equal probability, and we are calculating running averages,
\[
\frac{S_n}{n}=\frac{1}{n}\sum_{i=1}^{n}X_i, n=1,2,\ldots
\]

The SLLN (convergence almost surely) says that we can be 100% sure that this curve stretching off to the right will eventually, at some finite time, fall entirely within the bands forever afterward (to the right).

The R code used to generate this graph is below (plot labels omitted for brevity).

n <- 1000; m <- 50; e <- 0.05
s <- cumsum(2*(rbinom(n, size=1, prob=0.5) - 0.5))
plot(s/seq.int(n), type = "l", ylim = c(-0.4, 0.4))
abline(h = c(-e,e), lty = 2)



The WLLN (convergence in probability) says that a large proportion of the sample paths will be in the bands on the right-hand side, at time n
n
 (for the above it looks like around 48 or 9 out of 50). We can never be sure that any particular curve will be inside at any finite time, but looking at the mass of noodles above it'd be a pretty safe bet. The WLLN also says that we can make the proportion of noodles inside as close to 1 as we like by making the plot sufficiently wide.

The R code for the graph follows (again, skipping labels).

x <- matrix(2*(rbinom(n*m, size=1, prob=0.5) - 0.5), ncol = m)
y <- apply(x, 2, function(z) cumsum(z)/seq_along(z))
matplot(y, type = "l", ylim = c(-0.4,0.4))
abline(h = c(-e,e), lty = 2, lwd = 2)
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
疯狂英语王牌培训资料精选(二)
表示赞同、同意,除了yes,yep,right,sure,good,great,cool,还有什么词显得高端大气?
教你超实用的50种说“YES”的方法!
plot(simout.time,simout.signals.values)
地道英语口语21|My treat
【英语语法】对时态有特殊要求的十个句型
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服