大数强与弱定律背后的直觉(使用 R 模拟)

机器算法验证 r 直觉 大数定律
2022-04-01 16:38:33

这看起来相当基本,但是当提到大数的弱和强定律时,这是我看到的定义(卡塞拉和伯杰)

方程

您能否给出一个“直觉”来理解它们之间的区别。

另外,概率内的限制对于强定律意味着什么?

你能给我一个R中的模拟来表示它们之间的区别吗?

1个回答

将弱定律表述为 强定律为 \overline{ Y}_n\ \xrightarrow{as}\ \mu \,\textrm{ when }\ n \to \infty , \text{ ie } \Pr\!\left( \lim_{n\to\infty}\overline{ Y}_n = \mu \right) = 1

Y¯n P μ when  n, i.e. ε>0:limnPr(|Y¯nμ|<ε)=1
Y¯n a.s. μ when  n, i.e. Pr(limnY¯n=μ)=1

您可能会认为弱定律是说当样本量大时样本平均值通常接近均值,而强定律是说随着样本量的增加,样本平均值几乎肯定会收敛到均值。

当样本平均值接近平均值的失败大到足以阻止收敛时,就会发生差异。

作为使用 R 的说明,以维基百科的第一个示例为例,其中是指数分布的随机变量,参数为所以让我们考虑案例X1Y=sin(x)exxE[Y]=π210010000

set.seed(1)
cases <- 100
samplesize <- 10000
Xmat <- matrix(rexp(samplesize*cases, rate=1), ncol=samplesize)
Ymat <- sin(Xmat) * exp(Xmat) / Xmat
plot(samplemeans <- rowMeans(Ymat), 
    main="most sample averages close to expectation")
abline(h=pi/2, col="red")

在此处输入图像描述

但现在看看运行样本平均值在相同的万次观察中未能达到平均值并保持在那里1

plot(cumsum(Ymat)/(1:(samplesize*cases)),
    main="running sample average not always converging to expectation")
abline(h=pi/2, col="red")

在此处输入图像描述