大数定理的MATLAB编程,强大数定律和弱大数定律的图示

本文探讨了在简单的随机游走中,SLLN(几乎必然收敛)和WLLN(概率收敛)的概念。通过R语言实例,解释了如何观察和计算随机过程的平均行为,强调了两种极限定理在实际中的不同含义:SLLN保证了长期平均值的确定性收敛,而WLLN则关注样本路径的大量情况下,大部分会落入特定区间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

\]

a4c26d1e5885305701be709a3d33442f.png

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

s

plot(s/seq.int(n), type = "l", ylim = c(-0.4, 0.4))

abline(h = c(-e,e), lty = 2)

a4c26d1e5885305701be709a3d33442f.png

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

m)

y

matplot(y, type = "l", ylim = c(-0.4,0.4))

abline(h = c(-e,e), lty = 2, lwd = 2)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值

举报

选择你想要举报的内容(必选)
  • 内容涉黄
  • 政治相关
  • 内容抄袭
  • 涉嫌广告
  • 内容侵权
  • 侮辱谩骂
  • 样式问题
  • 其他
点击体验
DeepSeekR1满血版
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回顶部