In [25]:
library(ggplot2)

options(repr.plot.width=4, repr.plot.height=4)

Der zentrale Grenzwertsatz

Seine $X_1, \cdots, X_n$ eine Folge von unabhängigen und identisch verteilten Zufallsvariablen, so dass Mittelwert $\mu$ und Standardabweichung $\sigma$ definiert und endlich sind. Sei \begin{align} S_n &= X_1 + \cdots + X_n\\ Z_n &= \frac{S_n -n\mu}{\sigma\sqrt{n}} \end{align}

Dann gilt: \begin{align} \Phi(z) &\doteq \int_{-\infty}^z \frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}}dx\\ \lim_{n\rightarrow \infty} P(Z_n \leq z) &= \Phi(z) \end{align}

Vulgo: Die Summe von i.i.d. Zufallsvariablen kann durch eine Normalverteilung approximiert werden.

Illustration des zentralen Grenzwertsatzes

Für eine Standard-Gleichverteilung in $[0, 1]$ gilt:

  • $\mu = \frac{1}{2}$
  • $\sigma = \frac{\sqrt{3}}{6}$

Wenn $x$ standard-gleichverteilt ist, hat $\sqrt{3}~(2x-1)$ Mittelwert 0 und Standardabweichung 1.

In [30]:
x <- replicate(10000, sum(replicate(1000, 
                                    sqrt(3)*(2*runif(1)-1)))/sqrt(1000))

ggplot(data.frame(x), aes(x=x)) + 
    geom_histogram(aes(y = ..density..), color='black', fill='white') + 
    geom_density(col='red')

(mean(x))
(sd(x))
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
0.0320342153906204
0.993386016033942
In [29]:
qqnorm(x)
abline(h=0)
abline(v=0)
In [31]:
ks.test(x, "pnorm")
	One-sample Kolmogorov-Smirnov test

data:  x
D = 0.019204, p-value = 0.001252
alternative hypothesis: two-sided
In [32]:
shapiro.test(x[1:5000])
	Shapiro-Wilk normality test

data:  x[1:5000]
W = 0.99965, p-value = 0.5556
In [34]:
ks.test(runif(100), "pnorm")
	One-sample Kolmogorov-Smirnov test

data:  runif(100)
D = 0.50006, p-value < 2.2e-16
alternative hypothesis: two-sided
In [ ]: