diff --git a/cheatsheet/cheatsheet.tex b/cheatsheet/cheatsheet.tex new file mode 100644 index 0000000..5382663 --- /dev/null +++ b/cheatsheet/cheatsheet.tex @@ -0,0 +1,277 @@ + + +\documentclass[12pt,landscape]{article} +\usepackage[ngerman]{babel} +\usepackage{multicol} +\usepackage{calc} +\usepackage{ifthen} +\usepackage[landscape]{geometry} +\usepackage{amsmath,amsthm,amsfonts,amssymb} +\usepackage{color,graphicx,overpic} +\usepackage{hyperref} +\usepackage[utf8]{inputenc} +\usepackage{algpseudocode} + +% This sets page margins to .5 inch if using letter paper, and to 1cm +% if using A4 paper. (This probably isn't strictly necessary.) +% If using another size paper, use default 1cm margins. +\ifthenelse{\lengthtest { \paperwidth = 11in}} +{ \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} } +{\ifthenelse{ \lengthtest{ \paperwidth = 297mm}} + {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } + {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } +} + +% Turn off header and footer +\pagestyle{empty} + +% Redefine section commands to use less space +\makeatletter +\renewcommand{\section}{\@startsection{section}{1}{0mm}% + {-1ex plus -.5ex minus -.2ex}% + {0.5ex plus .2ex}%x + {\normalfont\large\bfseries}} +\renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}% + {-1explus -.5ex minus -.2ex}% + {0.5ex plus .2ex}% + {\normalfont\normalsize\bfseries}} +\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{0mm}% + {-1ex plus -.5ex minus -.2ex}% + {1ex plus .2ex}% + {\normalfont\small\bfseries}} +\makeatother + +% itemize with smaller skips +\newenvironment{tightitemize} +{\begin{itemize} + \setlength{\itemsep}{2pt} + \setlength{\parskip}{0pt} + \setlength{\parsep}{0pt}} + {\end{itemize}} + + +% Define BibTeX command +\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} + +% Don't print section numbers +\setcounter{secnumdepth}{0} + + +\setlength{\parindent}{0pt} +\setlength{\parskip}{0pt plus 0.5ex} + +\renewcommand{\lg}{\log_{10}} + + +\begin{document} + \raggedright + \footnotesize + \begin{multicols*}{4} + % multicol parameters + % These lengths are set only within the two main columns + %\setlength{\columnseprule}{0.25pt} + \setlength{\premulticols}{1pt} + \setlength{\postmulticols}{1pt} + \setlength{\multicolsep}{1pt} + \setlength{\columnsep}{2pt} + + \begin{center} + \section*{Statistik 1} + \end{center} + \subsection{Basics} + \textbf{Mittelwert:} $\bar{x}= \frac{1}{n}\sum_{i=1}^{n}x_i$\\ + \textbf{Varianz:} $s^2= \frac{1}{n}\sum_{i=1}^{n}(x_i-\bar{x})^2= \frac{1}{n}\sum_{i=1}^{n}x_i^2-\bar{x}^2$\\ + \textbf{Standardabweichung:} $s = \sqrt{s^2}$ + \subsection{Diskrete Zufallsvariablen} + \textbf{Erwartungswert:} $\mu=E(X)=\sum_{i=1}^{n}x_i \cdot P(X=x_i)$\\ + \textbf{Varianz:} $\sigma=Var(X)=\sum_{i=1}^{n} (x_i-\mu)^2 \cdot P(X=x_i)$\\ + \textbf{Kovarianz:} $cov(X,Y)=(\frac{1}{n}\sum_{i=1}^{n}(x_i\cdot y_i))- (\bar{x}-\bar{y}) $\\ + \textbf{Korrelation:} $r_{X,Y}=\frac{cov(X,Y)}{\sigma_X \sigma_Y}$ + \subsection{Verteilungen} + \subsubsection{Diskret} + \textbf{Bernoulli:} $P(X=x)=p$ bzw. $1-p$,\\ + $E(X)=p, Var(X)=p-p^2$\\ + \textbf{Gleichvert:} $P(X=x)=\frac{1}{n}$,\\ + $E(X)=\frac{n+1}{2}, Var(X)=\frac{n^2-1}{12}$ + \textbf{Binomialvert:}\\ + $P(X=x)=\binom{n}{k}p^k(1-p)^{n-k}$,\\ + $E(X)=np, Var(X)=n(p-p^2)$\\ + \textbf{Poissonvert:} $P(X=x)=\frac{\mu}{x!}e^{-\mu}$\\ + $E(X)=Var(X)=\mu=np$ + \subsubsection{Kontinuierlich} + \textbf{Rechtecksvert:}\\ + $a \leq x \leq b : f(X)=\frac{1}{b-a}$\\ + $F(X)= \frac{1}{b-a}(x-a)$\\ + $E(X)=\frac{a+b}{2}, Var(X)=\frac{(a-b)^2}{12}$\\ + \textbf{Normalvert:}\\ + $X \sim N(\mu,\sigma)$\\ + $f(X)=\frac{1}{\sigma\sqrt{2\pi}}\exp(-\frac{1}{2}(\frac{x-\mu}{\sigma}))$\\ + $E(X)=\mu, Var(X)=\sigma^2$\\ + \textbf{Standardnormalvert:}\\ + $Z=\frac{X-\mu}{\sigma} \sim N(0,1)$ + \begin{center} + \section{Parameterschätzung} + \end{center} + \subsection{Kriterien von Schätzstatistiken} + \textbf{Erwartungstreue:} $E(T)=\theta+Bias$, \\ + $T$ ist erwartungstreu $\Leftrightarrow E(T)=\theta$\\ + \textbf{Konsistenz:} $\underset{n \rightarrow \infty}{\lim} P(|T-\theta| < \epsilon)=1$\\ + \textbf{Wirksamkeit:} $MSE= Var(T) + Bias(T)^2$ \\ + $MSE(T_1) \mu_0$\\ + $z_{beob}=\frac{\bar{X}-\mu_0}{\sigma}\sqrt{n} \sim N(0,1)$ + + (a) $|z_{beob}|>z_{1-\frac{\alpha}{2}} \Rightarrow H_1$\\ + (b) $z_{beob}<-z_{1-\alpha} \Rightarrow H_1$\\ + (c) $z_{beob}>z_{1-\alpha} \Rightarrow H_1$\\ + \textbf{$\sigma$ unbekannt:} t-Test\\ + (a) $H_0: \mu = \mu_0, H_1: \mu \neq \mu_0$\\ + (b) $H_0: \mu \geq \mu_0, H_1: \mu < \mu_0$\\ + (c) $H_0: \mu \leq \mu_0, H_1: \mu > \mu_0$\\ + $t_{beob}=\frac{\bar{X}-\mu_0}{\hat{\sigma}}\sqrt{n} \sim N(0,1)$\\ + (a) $|t_{beob}|>t_{1-\frac{\alpha}{2}}(n-1) \Rightarrow H_1$\\ + (b) $t_{beob}<-t_{1-\alpha}(n-1) \Rightarrow H_1$\\ + (c) $t_{beob}>t_{1-\alpha}(n-1) \Rightarrow H_1$\\ + \subsection{Zwei Stichproben} + \subsubsection{unabhängige Stichproben} + \textbf{parametrisch:}\\ + $D = X - Y$ $(d_i=x_i-y_i)$\\ + \underline{Hypothesen:}\\ + (a)$H_0: \mu_X - \mu_Y = \delta_0, H_1: \mu_X - \mu_Y \neq \delta_0$\\ + (b)$H_0: \mu_X - \mu_Y \geq \delta_0, H_1: \mu_X - \mu_Y<\delta_0$\\ + (c)$H_0: \mu_X - \mu_Y \leq \delta_0, H_1: \mu_X - \mu_Y > \delta_0$\\ + \underline{$\sigma$ gleich, bekannt:} 2-Stichproben-z-Test\\ + $z_{beob}=\frac{D-\delta_0}{\sqrt{\frac{\sigma^2_X}{n}+\frac{\sigma^2_Y}{m}}}=\frac{D-\delta_0}{\sigma\sqrt{\frac{1}{n}+\frac{1}{m}}}$\\ + (a) $|z_{beob}|>z_{1-\frac{\alpha}{2}} \Rightarrow H_1$\\ + (b) $z_{beob}<-z_{1-\alpha} \Rightarrow H_1$\\ + (c) $z_{beob}>z_{1-\alpha} \Rightarrow H_1$\\ + \underline{$\sigma$ gleich, unbekannt:} 2-StiPro-t-Test\\ + $t_{beob}=\frac{D-\delta_0}{\hat{\sigma}\sqrt{\frac{1}{n}+\frac{1}{m}}}$ mit $\hat{\sigma}=\frac{(n-1)\hat{\sigma}^2_X+(m-1)\hat{\sigma}^2_Y}{n+m-2}$\\ + $df= n+m-2$\\ + (a) $|t_{beob}|>t_{1-\frac{\alpha}{2}}(df) \Rightarrow H_1$\\ + (b) $t_{beob}<-t_{1-\alpha}(df) \Rightarrow H_1$\\ + (c) $t_{beob}>t_{1-\alpha}(df) \Rightarrow H_1$\\ + \underline{$\sigma$ verschieden, unbekannt:} 2-SP-t-Test\\ + $t_{beob}=\frac{D-\delta_0}{\sqrt{\frac{\hat{\sigma}^2_X}{n}+\frac{\hat{\sigma}^2_Y}{m}}}$\\ + $df= min(n,m)-1$\\ + (a) $|t_{beob}|>t_{1-\frac{\alpha}{2}}(df) \Rightarrow H_1$\\ + (b) $t_{beob}<-t_{1-\alpha}(df) \Rightarrow H_1$\\ + (c) $t_{beob}>t_{1-\alpha}(df) \Rightarrow H_1$\\ + \textbf{parameterfrei:} Wilcoxon-Rangsummen-Test\\ + Required: $min(m,n)\geq 4, n+m>30$\\ + Beobachtungen X+Y ordnen\\ + Kleinere Stichprobe aufsummieren\\ + $R=\sum R_i$ (Rang der $i$-ten Beobachtung)\\ + Unter $H_0$ alles Pos gleichwahrscheinlich\\ + $E(R|H_0)=\frac{n(n+m+1)}{2}$\\ + $Var(R|H_0)=\frac{nm(n+m+1)}{12}$\\ + $z_{beob}=\frac{R-E(R|H_0)}{\sqrt{Var(R|H_0)}}$ + %TODO Tuckeys Pocket Test + \subsubsection{abhängige Stichproben} + \textbf{parametrisch:} \\ + $D = X - Y$ $(d_i=x_i-y_i)$\\ + Annahme: $D \sim N(\mu,\sigma_D)$\\ + \underline{Hypothesen:}\\ + (a)$H_0: \mu_X - \mu_Y = \delta_0, H_1: \mu_X - \mu_Y \neq \delta_0$\\ + (b)$H_0: \mu_X - \mu_Y \geq \delta_0, H_1: \mu_X - \mu_Y<\delta_0$\\ + (c)$H_0: \mu_X - \mu_Y \leq \delta_0, H_1: \mu_X - \mu_Y > \delta_0$\\ + \underline{$\sigma_D$ bekannt:}\\ + $z_{beob}=\frac{\bar{D}-\delta_0}{\sigma_D}\sqrt{n} \sim N(0,1)$\\ + (a) $|z_{beob}|>z_{1-\frac{\alpha}{2}} \Rightarrow H_1$\\ + (b) $z_{beob}<-z_{1-\alpha} \Rightarrow H_1$\\ + (c) $z_{beob}>z_{1-\alpha} \Rightarrow H_1$\\ + \underline{$\sigma_D$ unbekannt:}\\ + $t_{beob}=\frac{\bar{D}-\delta_0}{\hat{\sigma}_D}\sqrt{n} \sim t(n-1)$\\ + (a) $|t_{beob}|>t_{1-\frac{\alpha}{2}}(df) \Rightarrow H_1$\\ + (b) $t_{beob}<-t_{1-\alpha}(df) \Rightarrow H_1$\\ + (c) $t_{beob}>t_{1-\alpha}(df) \Rightarrow H_1$\\ + \textbf{parameterfrei:}\\ + \underline{Vorzeichentest:}\\ + $H_0: p_+ = p_-, H_1: p_+ \neq P_-$\\ + 1. Alle $d_i=x_i-y_i$ berechnen\\ + 2. $i=\sum +$ berechnen\\ + 3. $P(S=i)=\binom{n}{i}\cdot p^i(1-p)^{n-i}$\\ + 4. Noch unrealistischere Werte berechnen ($P(S < i)$ oder $P(S > i)$)\\ + 5. $P(S \leq i) \overset{?}{>} \alpha$ bzw. $P(S \geq i) \overset{?}{>} \alpha$\\ + 6. $H_0$ wird verworfen, wenn $p < \alpha$ + \underline{Wilcoxon-Vorzeichen-Rang-Test:} + $H_0: E(R_+) = E(R_-)$\\ + 1. Alle $d_i=x_i-y_i$ berechnen\\ + 2. Allen $|d_i|$ einen Rang zuweisen + 3. Rangsummen berechnen für $d_i < 0 (R_-)$ und $d_i > 0 (R_+)$\\ + 4. IF $n \geq 20$:\\ + $E(R_+)=\frac{n(n+1)}{4}$\\ + $Var(R_+)=\frac{n(n+1)(2n+1)}{24}$\\ + $z_{beob}=\frac{R_+-E(R_+)}{\sqrt{Var(R_+)}} \sim N(0,1)$\\ + \subsection{Vergleich zweier Wahrscheinlichkeiten} + Voraussetzung: $n_1\cdot \hat{p}_1(1-\hat{p}_1) > 9, n_2\cdot \hat{p}_2(1-\hat{p}_2) > 9$\\ + Prüfgröße: $D=\hat{p}_1-\hat{p}_2$\\ + $H_0: p_1 = p_2$\\ + Für $n>0$: $z_{beob}=\frac{D-0}{\sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}}$ + \subsection{Vergleich zweier Varianzen} + $F=\frac{max(\hat{\sigma}^2_A,\hat{\sigma}^2_B)}{min(\hat{\sigma}^2_A,\hat{\sigma}^2_B)}, df_{Zaehler},df_{Nenner}$ + \subsection{$\chi^2$ Anpassungstest} + $H_0:$ bestimmte Verteilung liegt vor,\\ + $H_1:$ liegt nicht vor\\ + $h_i$ beobachtete Häufigkeit\\ + $e_i$ angenommene Häufigkeit\\ + Voraussetzung: $e_i\geq5$\\ + $S_{beob}=\sum_{i=1}^{r}\frac{(h_i-e_i)^2}{e_i}$, $S \sim \chi^2(r-1)$ + \subsection{$\chi^2$ Unabhängigkeitstest} + $H_0:$ Merkmale unabhängig,\\ + $H_1:$ Merkmale abhängig\\ + 1. Kontingenztabelle gegeben:\\ + $\begin{array}{c|c|c|c|c} + & & & & \sum\\ + \hline + & h_{1,1} & h_{1,2} & h_{1,3} & h_{1,\bullet}\\ + \hline + & h_{2,1} & h_{2,2} & h_{2,3} & h_{2,\bullet} \\ + \hline + \sum & h_{\bullet, 1} & h_{\bullet, 2} & h_{\bullet,3} & n + \end{array}$\\ + 2. Neue Kontingenztabelle erstellen:\\ + $\begin{array}{c|c|c|c|c} + & & & & \sum\\ + \hline + & \hat{e}_{1,1} & \hat{e}_{1,2} & \hat{e}_{1,3} & h_{1,\bullet}\\ + \hline + & \hat{e}_{2,1} & \hat{e}_{2,2} & \hat{e}_{2,3} & h_{2,\bullet} \\ + \hline + \sum & h_{\bullet, 1} & h_{\bullet, 2} & h_{\bullet,3} & n + \end{array}$\\ + mit $\hat{e}_{i,j} = \frac{h_{i,\bullet} \cdot h_{\bullet, j}}{n}$\\ + 3. + $\chi^2_{beob}= \sum_{j=1}^{r}\sum_{i=1}^{m}\frac{(h_{ij}-\hat{e}_{ij)}}{\hat{e}_{ij}}$\\ + 4. $\chi^2_{krit}=\chi^2((r-1) \cdot (m-1))$ + \section{Varianzanalyse} + \end{multicols*} +\end{document} +