Définition de la loi gaussienne
Une loi gaussienne (ou normale) de moyenne \(\mu \in \mathbb{R}\) et de variance \(\sigma^2 > 0\) est la loi de densité
\[f(x) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x - \mu)^2}{2\sigma^2}\right)\]
On note \(\mathcal{N}(\mu, \sigma^2)\) cette loi. Lorsque \(\mu = 0\) et \(\sigma^2 = 1\), on parle de loi normale centrée réduite.
Propriétés
Je génère \(X \sim \mathcal{N}(0,1)\).
On observe \(0.37\). Cela pourrait-il provenir d’une \(\mathcal{N}(0,1)\) ?
On observe \(3.82\). Cela pourrait-il provenir d’une \(\mathcal{N}(0,1)\) ?
On observe \(-0.91\). Et ça ??
\(H_0\) : \(X \sim \mathcal N(0,1)\) VS \(H_1\) : \(X \sim \mathcal N(\mu, 1)\), \(\mu \neq 0\)
quantile(Normal(0,1), 0.975) = 1.962 * (1 - cdf(Normal(0,1), abs(3.82))) ≈ 0.0001On observe \((X_1, \dots, X_n)\) des variables aléatoires réelles iid.
TCL
Soit \(S_n = \sum_{i=1}^n X_i\) avec \((X_1, \dots, X_n)\) iid (\(L^2\)) alors \[ \frac{S_n - \mathbb E[S_n]}{\sqrt{\mathrm{Var}(S_n)}} \approx \mathcal N(0,1) \text{ quand } n \to \infty \]
Règle empirique : \(n \geq 30\) (!!! attention à cette règle)
C’est une égalité lorsque les \(X_i\) sont gaussiennes \(\mathcal N(\mu, \sigma^2)\)
Fixons \(p \in (0,1)\). Alors, \(\frac{\mathrm{Bin}(n,p) - np}{\sqrt{np(1-p)}} \approx \mathcal N(0,1)\) quand \(n \to \infty\)
\(n\) doit être \(\gg \frac{1}{p}\) (pas \(30\) !!!)
Bonne approximation pour (\(n=100\), \(p=0.2\))
Mauvaise approximation pour (\(n=100\), \(p=0.01\))
Définition de la loi du Chi-deux
Une loi du chi-deux à degré de liberté \(k\) est la loi de
\[X = \sum_{i=1}^k Z_i^2\]
où les \((Z_1, \dots, Z_k)\) sont iid \(\mathcal N(0,1)\). On note \(\chi^2(k)\) cette loi.
Propriétés
\(X = \sum_{i=1}^k Z_i^2\)
\[\mathbb{E}[X] = \sum_{i=1}^k \mathbb{E}[Z_i^2] = \sum_{i=1}^k 1 = k\]
\[\mathbb{V}[X] = \sum_{i=1}^k \mathbb{V}[Z_i^2] = k* (3-1) = 2k\]
Les \(Z_i^2\) sont iid de moyenne \(\mu = 1\) et de variance \(\sigma^2 = 2\). Par le TCL :
\[\frac{X - \mathbb E[X]}{\mathbb V(X)} = \frac{X - k}{\sqrt{2k}} \xrightarrow{\mathcal{L}} \mathcal{N}(0,1) \quad \text{quand } k \to +\infty\]
En réarrangeant :
\[X \approx k + \sqrt{2k}\,\mathcal{N}(0,1) \qquad \blacksquare\]
Je génère \(X \sim \chi^2(53)\).
On observe \(112.7\). Cela pourrait-il provenir d’une \(\chi^2(53)\) ?
On observe \(50.1\). Cela pourrait-il provenir d’une \(\chi^2(53)\) ?
On observe \(15.4\). Et ça ??
\(H_0\) : \(X \sim \chi^2(53)\) VS \(H_1\) : \(X \not\sim \chi^2(53)\)
quantile(Chisq(53), 0.025) = 34.78quantile(Chisq(53), 0.975) = 74.472 * min(cdf(Chisq(53), 112.7), 1 - cdf(Chisq(53), 112.7)) ≈ 0Définition de la loi de Student
Une loi de Student à degré de liberté \(k\) est la loi de
\[T = \frac{Z}{\sqrt{U/k}}\]
où \(Z\) et \(U\) sont indépendants, avec \(Z \sim \mathcal N(0,1)\) et \(U \sim \chi^2(k)\). On note \(\mathcal T(k)\) cette loi.
Propriétés
Espérance : Pour \(k > 1\), puisque \(Z\) et \(U\) sont indépendants, \[\mathbb{E}[T] = \mathbb{E}[Z] \cdot \mathbb{E}\!\left[\frac{1}{\sqrt{U/k}}\right] = 0\] car \(\mathbb{E}[Z] = 0\).
Normalité asymptotique : On écrit \(T = \frac{Z}{\sqrt{U/k}}\). Par la loi des grands nombres, \(U/k = \frac{1}{k}\sum_{i=1}^k Z_i^2 \xrightarrow{\text{p.s.}} \mathbb{E}[Z_1^2] = 1\) quand \(k \to \infty\). Puisque \(Z\) est indépendant de \(U\), on conclut par le théorème de Slutsky.
Je génère \(T \sim \mathcal{T}(10)\).
On observe \(-5.2\). Cela pourrait-il être anormalement petit pour une \(\mathcal{T}(10)\) ?
On observe \(3.45\). Cela pourrait-il être anormalement petit pour une \(\mathcal{T}(10)\) ?
On observe \(-0.15\). Et ça ??
\(H_0\) : \(T \sim \mathcal T(10)\) VS \(H_1\) : \(T \sim \mathcal T(10) + \mu\) avec \(\mu < 0\)
quantile(TDist(10), 0.05) = -1.81cdf(TDist(10), -3.45) = 0.003Définition de la loi de Fisher
Une loi de Fisher à degrés de liberté \((k_1, k_2)\) est la loi de
\(F = \frac{U_1/k_1}{U_2/k_2}\)
où \(U_1\) et \(U_2\) sont indépendants, avec \(U_1 \sim \chi^2(k_1)\) et \(U_2 \sim \chi^2(k_2)\). On note \(\mathcal F(k_1, k_2)\) cette loi.
Propriétés
En utilisant l’approximation du TCL \(U_1 \sim k_1 + \sqrt{2k_1} Z_1\) et \(U_2 \sim k_1 + \sqrt{2k_2} Z_2\)
\[F = \frac{U_1/k_1}{U_2/k_2} = \frac{1 + \sqrt{\frac{2}{k_1}}\,Z_1}{1 + \sqrt{\frac{2}{k_2}}\,Z_2} \approx 1 + \sqrt{\frac{2}{k_1}}\,Z_1 - \sqrt{\frac{2}{k_2}}\,Z_2\]
Puisque \(U_1\) et \(U_2\) sont indépendants, la variance du membre de droite est \(\frac{2}{k_1} + \frac{2}{k_2}\), donc :
\[F \approx 1 + \sqrt{\frac{2}{k_1} + \frac{2}{k_2}}\,\mathcal{N}(0,1)\]
Je génère \(F \sim \mathcal{F}(5, 20)\).
On observe \(1.12\). Cela pourrait-il être anormalement grand pour une \(\mathcal{F}(5,20)\) ?
On observe \(4.87\). Cela pourrait-il être anormalement grand pour une \(\mathcal{F}(5,20)\) ?
On observe \(0.95\). Et ça ??
\(H_0\) : \(F \sim \mathcal F(5,20)\) VS \(H_1\) : \(F\) est stochastiquement plus grande que \(\mathcal F(5,20)\)
quantile(FDist(5,20), 0.95) = 2.711 - cdf(FDist(5,20), 4.87) = 0.004Note
Soit \(Y \sim \mathcal{N}(0, I_n)\). Soient \(E\) et \(F\) deux sous-espaces orthogonaux de \(\mathbb{R}^n\), c’est-à-dire \(E \perp F\), de dimensions \(\dim(E) = p\) et \(\dim(F) = q\). On note \(\Pi_E\) et \(\Pi_F\) les projections orthogonales sur \(E\) et \(F\) respectivement. Alors :
Indépendance : \(\Pi_E Y\) et \(\Pi_F Y\) sont des vecteurs gaussiens indépendants.
Lois du chi-deux : \(\|\Pi_E Y\|^2 \sim \chi^2(p)\) et \(\|\Pi_F Y\|^2 \sim \chi^2(q)\).
Décomposition pythagoricienne : Si \(\mathbb{R}^n = E \oplus F\) (c’est-à-dire \(p + q = n\)), alors \(\|Y\|^2 = \|\Pi_E Y\|^2 + \|\Pi_F Y\|^2\)
voir aussi la démonstration