\Section[
    \eng{Probability theory}
    \ger{Wahrscheinlichkeitstheorie}
]{pt}

    \begin{formula}{mean}
        \absLabel
        \desc{Mean}{Expectation value}{}
        \desc[german]{Mittelwert}{Erwartungswert}{}
        \eq{\braket{x} = \int w(x)\, x\, \d x}
    \end{formula}


    \begin{formula}{variance}
        \absLabel
        \desc{Variance}{Square of the \fqEqRef{math:pt:std-deviation}}{}
        \desc[german]{Varianz}{Quadrat der\fqEqRef{math:pt:std-deviation}}{}
        \eq{\sigma^2 = (\Delta \hat{x})^2 = \Braket{\hat{x}^2} - \braket{\hat{x}}^2 = \braket{(x - \braket{x})^2}}
    \end{formula}

    \begin{formula}{covariance}
        \absLabel
        \desc{Covariance}{}{}
        \desc[german]{Kovarianz}{}{}
        \eq{\cov(x,y) = \sigma(x,y) = \sigma_{XY} = \Braket{(x-\braket{x})\,(y-\braket{y})}}
    \end{formula}
    
    \begin{formula}{std-deviation}
        \absLabel
        \desc{Standard deviation}{}{}
        \desc[german]{Standardabweichung}{}{}
        \eq{\sigma = \sqrt{\sigma^2} = \sqrt{(\Delta x)^2}}
    \end{formula}

    \begin{formula}{median}
        \desc{Median}{Value separating lower half from top half}{$x$ dataset with $n$ elements}
        \desc[german]{Median}{Teilt die untere von der oberen Hälfte}{$x$ Reihe mit $n$ Elementen}
        \eq{
            \textrm{med}(x) = \left\{ \begin{array}{ll} x_{(n+1)/2} & \text{$n$ \GT{odd}} \\ \frac{x_{(n/2)}+x_{((n/2)+1)}}{2} & \text{$n$ \GT{even}} \end{array} \right.
        }
    \end{formula}

    \begin{formula}{pdf}
        \desc{Probability density function}{Random variable has density $f$. The integral gives the probability of $X$ taking a value $x\in[a,b]$.}{$f$ normalized: $\int_{-\infty}^\infty f(x) \d x= 1$}
        \desc[german]{Wahrscheinlichkeitsdichtefunktion}{Zufallsvariable hat Dichte $f$. Das Integral gibt Wahrscheinlichkeit an, dass $X$ einen Wert $x\in[a,b]$ annimmt}{$f$ normalisiert $\int_{-\infty}^\infty f(x) \d x= 1$}
        \eq{P([a,b]) := \int_a^b f(x) \d x}
    \end{formula}

    \begin{formula}{cdf}
        \desc{Cumulative distribution function}{}{$f$ probability density function}
        \desc[german]{Kumulative Verteilungsfunktion}{}{$f$ Wahrscheinlichkeitsdichtefunktion}
        \eq{F(x) = \int_{-\infty}^x f(t) \d t}
    \end{formula}

    \begin{formula}{pmf}
        \desc{Probability mass function}{Probability $p$ that \textbf{discrete} random variable $X$ has exact value $x$}{$P$ probability measure}
        \desc[german]{Wahrscheinlichkeitsfunktion / Zählfunktion}{Wahrscheinlichkeit $p$ dass eine \textbf{diskrete} Zufallsvariable $X$ einen exakten Wert $x$ annimmt}{}
        \eq{p_X(x) = P(X = x)}
    \end{formula}

    \begin{formula}{autocorrelation} \absLabel
        \desc{Autocorrelation}{Correlation of $f$ to itself at an earlier point in time, $C$ is a covariance function}{$\tau$ lag-time}
        \desc[german]{Autokorrelation}{Korrelation vonn $f$ zu sich selbst zu einem früheren Zeitpunkt. $C$ ist auch die Kovarianzfunktion}{$\tau$ Zeitverschiebung}
        \eq{C_A(\tau) &= \lim_{T \to \infty} \frac{1}{2T}\int_{-T}^{T} f(t+\tau) f(t) \d t) \\ &= \braket{f(t+\tau)\cdot f(t)}}
    \end{formula}

    \begin{formula}{binomial_coefficient}
        \desc{Binomial coefficient}{Number of possibilitites of choosing $k$ objects out of $n$ objects\\}{}
        \desc[german]{Binomialkoeffizient}{Anzahl der Möglichkeiten, $k$ aus $n$ zu wählen\\ "$n$ über $k$"}{}
        \eq{\binom{n}{k} = \frac{n!}{k!(n-k)!}}
    \end{formula}

    \Subsection[
        \eng{Distributions}
        \ger{Verteilungen}
    ]{distributions}
        \Subsubsection[
            \eng{Continuous probability distributions}
            \ger{Kontinuierliche Wahrscheinlichkeitsverteilungen}
        ]{cont}
            \begin{bigformula}{normal} 
                \absLabel[normal_distribution]
                \desc{Gauß/Normal distribution}{}{}
                \desc[german]{Gauß/Normal-Verteilung}{}{}
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_gauss.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{\mu \in \R,\quad \sigma^2 \in \R}
                    \disteq{support}{x \in \R}
                    \disteq{pdf}{\frac{1}{\sqrt{2\pi\sigma^2}}\exp \left(-\frac{(x-\mu)^2}{2\sigma^2}\right)}
                    \disteq{cdf}{\frac{1}{2}\left[1 + \erf \left(\frac{x-\mu}{\sqrt{2}\sigma}\right)\right]}
                    \disteq{mean}{\mu}
                    \disteq{median}{\mu}
                    \disteq{variance}{\sigma^2}
                \end{distribution}
            \end{bigformula}

            \begin{formula}{standard_normal}
                \absLabel[standard_normal_distribution]
                \desc{Density function of the standard normal distribution}{$\mu = 0$, $\sigma = 1$}{}
                \desc[german]{Dichtefunktion der Standard-Normalverteilung}{$\mu = 0$, $\sigma = 1$}{}
                \eq{\varphi(x) = \frac{1}{\sqrt{2\pi}} \e^{-\frac{1}{2}x^2}}
            \end{formula}

            \begin{bigformula}{multivariate_normal}
                \absLabel[multivariate_normal_distribution]
                \desc{Multivariate normal distribution}{Multivariate Gaussian distribution}{$\vec{mu}$ \absRef{mean}, $\mat{\Sigma}$ \absRef{covariance}}
                \desc[german]{Mehrdimensionale Normalverteilung}{Multivariate Normalverteilung}{}
                \begin{distribution}
                    \disteq{parameters}{\vec{\mu} \in \R^k,+\quad \mat{\Sigma} \in \R^{k\times k}}
                    \disteq{support}{\vec{x} \in \vec{\mu} + \text{span}(\mat{\Sigma})}
                    \disteq{pdf}{\mathcal{N}(\vec{mu}, \mat{\Sigma}) = \frac{1}{(2\pi)^{k/2}} \frac{1}{\sqrt{\det{\Sigma}}} \Exp{-\frac{1}{2} \left(\vecx-\vec{\mu}\right)^\T \mat{\Sigma}^{-1} \left(\vecx-\vec{\mu}\right)}}
                    \disteq{mean}{\vec{\mu}}
                    \disteq{variance}{\mat{\Sigma}}
                \end{distribution}
            \TODO{k-variate normal plot}
            \end{bigformula}

            \begin{formula}{laplace}
                \absLabel[laplace_distribution]
                \desc{Laplace-distribution}{}{}
                \desc[german]{Laplace-Verteilung}{}{}
                \TODO{TODO}
            \end{formula}

            \begin{bigformula}{cauchy}
                \absLabel[lorentz_distribution]
                \desc{Cauchys / Lorentz distribution}{Also known as Cauchy-Lorentz distribution, Lorentz(ian) function, Breit-Wigner distribution.}{}
                \desc[german]{Cauchy / Lorentz-Verteilung}{Auch bekannt als Cauchy-Lorentz Verteilung, Lorentz Funktion, Breit-Wigner Verteilung.}{}
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_cauchy.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{x_0 \in \R,\quad \gamma \in \R}
                    \disteq{support}{x \in \R}
                    \disteq{pdf}{\frac{1}{\pi\gamma\left[1+\left(\frac{x-x_0}{\gamma}\right)^2\right]}}
                    \disteq{cdf}{\frac{1}{\pi}\arctan\left(\frac{x-x_0}{\gamma}\right) + \frac{1}{2}}
                    \disteq{mean}{\text{\GT{undefined}}}
                    \disteq{median}{x_0}
                    \disteq{variance}{\text{\GT{undefined}}}
                \end{distribution}
            \end{bigformula}

            \begin{bigformula}{maxwell-boltzmann}
                \absLabel[maxwell-boltzmann_distribution]
                \desc{Maxwell-Boltzmann distribution}{}{}
                \desc[german]{Maxwell-Boltzmann Verteilung}{}{}
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_maxwell-boltzmann.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{a > 0}
                    \disteq{support}{x \in (0, \infty)}
                    \disteq{pdf}{\sqrt{\frac{2}{\pi}} \frac{x^2}{a^3} \exp\left(-\frac{x^2}{2a^2}\right)}
                    \disteq{cdf}{\erf \left(\frac{x}{\sqrt{2} a}\right) - \sqrt{\frac{2}{\pi}} \frac{x}{a} \exp\left({\frac{-x^2}{2a^2}}\right)}
                    \disteq{mean}{2a \frac{2}{\pi}}
                    \disteq{median}{}
                    \disteq{variance}{\frac{a^2(3\pi-8)}{\pi}}
                \end{distribution}
            \end{bigformula}


            \begin{bigformula}{gamma}
                \absLabel[gamma_distribution]
                \desc{Gamma Distribution}{with $\lambda$ parameter}{$\Gamma$ \fqEqRef{math:cal:integral:list:gamma}, $\gamma$ \fqEqRef{math:cal:integral:list:lower_incomplete_gamma_function}}
                \desc[german]{Gamma Verteilung}{mit $\lambda$ Parameter}{}
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_gamma.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{\alpha > 0, \lambda > 0}
                    \disteq{support}{x\in(0,1)}
                    \disteq{pdf}{\frac{\lambda^\alpha}{\Gamma(\alpha) x^{\alpha-1} \e^{-\lambda x}}}
                    \disteq{cdf}{\frac{1}{\Gamma(\alpha) \gamma(\alpha, \lambda x)}}
                    \disteq{mean}{\frac{\alpha}{\lambda}}
                    \disteq{variance}{\frac{\alpha}{\lambda^2}}
                \end{distribution}
            \end{bigformula}

            \begin{bigformula}{beta}
                \desc{Beta Distribution}{}{$\txB$ \fqEqRef{math:cal:integral:list:beta_function} / \fqEqRef{math:cal:integral:list:incomplete_beta_function}}
                \desc[german]{Beta Verteilung}{}{}
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_beta.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{\alpha \in \R, \beta \in \R}
                    \disteq{support}{x\in[0,1]}
                    \disteq{pdf}{\frac{x^{\alpha-1} (1-x)^{\beta-1}}{\txB(\alpha,\beta)}}
                    \disteq{cdf}{\frac{\txB(x;\alpha,\beta)}{\txB(\alpha,\beta)}}
                    \disteq{mean}{\frac{\alpha}{\alpha+\beta}}
                    % \disteq{median}{\frac{}{}} % pretty complicated, probably not needed
                    \disteq{variance}{\frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}}
                \end{distribution}
            \end{bigformula}


        \Subsubsection[
            \eng{Discrete probability distributions}
            \ger{Diskrete Wahrscheinlichkeitsverteilungen}
        ]{discrete}
            \begin{bigformula}{binomial}
                \desc{Binomial distribution}{}{}
                \desc[german]{Binomialverteilung}{}{}
                \begin{ttext}
                    \eng{For the number of trials going to infinity ($n\to\infty$), the binomial distribution converges to the   \hyperref[sec:pb:distributions:poisson]{poisson distribution}}
                    \ger{Geht die Zahl der Versuche gegen unendlich ($n\to\infty$), konvergiert die Binomualverteilung gegen die \hyperref[sec:pb:distributions:poisson]{Poissonverteilung}}
                \end{ttext}\\
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_binomial.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{n \in \Z, \quad p \in [0,1],\quad q = 1 - p}
                    \disteq{support}{k \in \{0,\,1,\,\dots,\,n\}}
                    \disteq{pmf}{\binom{n}{k} p^k q^{n-k}}
                    % \disteq{cdf}{\text{regularized incomplete beta function}}
                    \disteq{mean}{np}
                    \disteq{median}{\floor{np} \text{ or } \ceil{np}}
                    \disteq{variance}{npq = np(1-p)}
                \end{distribution}
            \end{bigformula}

            \begin{bigformula}{poisson}
                \desc{Poisson distribution}{}{}
                \desc[german]{Poissonverteilung}{}{}
                \begin{minipage}{\distleftwidth}
                    \begin{figure}[H]
                        \centering
                        \includegraphics[width=\textwidth]{img/distribution_poisson.pdf}
                    \end{figure}
                \end{minipage}
                \begin{distribution}
                    \disteq{parameters}{\lambda \in (0,\infty)}
                    \disteq{support}{k \in \N}
                    \disteq{pmf}{\frac{\lambda^k \e^{-\lambda}}{k!}}
                    \disteq{cdf}{\e^{-\lambda} \sum_{j=0}^{\floor{k}} \frac{\lambda^j}{j!}}
                    \disteq{mean}{\lambda}
                    \disteq{median}{\approx\floor*{\lambda + \frac{1}{3} - \frac{1}{50\lambda}}}
                    \disteq{variance}{\lambda}
                \end{distribution}
            \end{bigformula}



        % TEMPLATE
        % \begin{distribution}{maxwell-boltzmann}
        %     \distdesc{Maxwell-Boltzmann distribution}{}
        %     \distdesc[german]{Maxwell-Boltzmann Verteilung}{}
        %     \disteq{parameters}{}
        %     \disteq{pdf}{}
        %     \disteq{cdf}{}
        %     \disteq{mean}{}
        %     \disteq{median}{}
        %     \disteq{variance}{}
        % \end{distribution}


    \Subsection[
        \eng{Central limit theorem}
        \ger{Zentraler Grenzwertsatz}
        ]{cls}  
        \begin{ttext}
            \eng{
                Suppose $X_1, X_2, \dots$ is a sequence of independent and identically distributed random variables with $\braket{X_i} = \mu$ and $(\Delta X_i)^2 = \sigma^2 < \infty$.
                As $N$ approaches infinity, the random variables $\sqrt{N}(\bar{X}_N - \mu)$ converge to a normal distribution $\mathcal{N}(0, \sigma^2)$.
                \\ That means that the variance scales with $\frac{1}{\sqrt{N}}$ and statements become accurate for large $N$.
            }
            \ger{
                Sei $X_1, X_2, \dots$ eine Reihe unabhängiger und gleichverteilter Zufallsvariablen mit $\braket{X_i} = \mu$ und $(\Delta X_i)^2 = \sigma^2 < \infty$.
                Für $N$ gegen unendlich konvergieren die Zufallsvariablen $\sqrt{N}(\bar{X}_N - \mu)$ zu einer Normalverteilung $\mathcal{N}(0, \sigma^2)$.
                \\ Das bedeutet, dass die Schwankung mit $\frac{1}{\sqrt{N}}$ wächst und Aussagen für große $N$ scharf werden.
            }
        \end{ttext}

    \Subsection[
        \eng{Propagation of uncertainty / error}
        \ger{Fehlerfortpflanzung}
    ]{error}
        \begin{formula}{generalised}
            \desc{Generalized error propagation}{}{$V$ \fqEqRef{math:pt:covariance} matrix, $J$ \fqEqRef{math:cal:jacobi-matrix}}
            \desc[german]{Generalisiertes Fehlerfortpflanzungsgesetz}{$V$ \fqEqRef{math:pt:covariance} Matrix, $J$ \fqEqRef{cal:jacobi-matrix}}{}
            \eq{V_y = J(x) \cdot V_x \cdot J^{\T} (x)}
        \end{formula}

        \begin{formula}{uncorrelated}
            \desc{Propagation of uncorrelated errors}{Linear approximation}{}
            \desc[german]{Fortpflanzung unabhängiger fehlerbehaftete Größen}{Lineare Näherung}{}
            \eq{u_y = \sqrt{ \sum_{i} \left(\pdv{y}{x_i}\cdot u_i\right)^2}}
        \end{formula}

        \begin{formula}{weight}
            \desc{Weight}{Variance is a possible choice for a weight}{$\sigma$ \fqEqRef{math:pt:variance}}
            \desc[german]{Gewicht}{Varianz ist eine mögliche Wahl für ein Gewicht}{}
            \eq{w_i = \frac{1}{\sigma_i^2}}
        \end{formula}

        \begin{formula}{weighted-mean}
            \desc{Weighted mean}{}{$w_i$ \fqEqRef{math:pt:error:weight}}
            \desc[german]{Gewichteter Mittelwert}{}{}
            \eq{\overline{x} = \frac{\sum_{i} (x_i  w_i)}{\sum_i w_i}}
        \end{formula}

        \begin{formula}{weighted-mean-error}
            \desc{Variance of weighted mean}{}{$w_i$ \fqEqRef{math:pt:error:weight}}
            \desc[german]{Varianz des gewichteten Mittelwertes}{}{}
            \eq{\sigma^2_{\overline{x}} = \frac{1}{\sum_i w_i}}
        \end{formula}

    \Subsection[
        \eng{Maximum likelihood estimation}
        \ger{Maximum likelihood Methode}
    ]{mle}
        \begin{formula}{likelihood}
            \desc{Likelihood function}{Likelihood of observing $x$ when parameter is $\theta$\\in general not normalized!}{$\rho$ \fqEqRef{math:pt:pdf} $x\mapsto \rho(x|\theta)$ depending on parameter $\theta$, $\Theta$ parameter space}
            \desc[german]{Likelihood Funktion}{"Plausibilität" $x$ zu messen, wenn der Parameter $\theta$ ist\\nicht normalisiert!}{$\rho$ \fqEqRef{math:pt:pdf} $x\mapsto \rho(x|\theta)$ hängt ab von Parameter $\theta$, $\Theta$ Parameterraum}
            \eq{L:\Theta \rightarrow [0,1], \quad \theta \mapsto \rho(x|\theta)}
        \end{formula}
        \begin{formula}{likelihood_independant}
            \desc{Likelihood function}{for independent and identically distributed random variables}{$x_i$ $n$ random variables, $\rho$ \fqEqRef{math:pt:pdf} $x\mapsto f(x|\theta)$ depending on parameter $\theta$}
            \desc[german]{Likelihood function}{für unabhängig und identisch verteilte Zufallsvariablen}{$x_i$ $n$ Zufallsvariablen$\rho$ \fqEqRef{math:pt:pdf} $x\mapsto f(x|\theta)$ hängt ab von Parameter $\theta$}
            \eq{L(\theta) = \prod_{i=1}^n f(x_i;\theta)}
        \end{formula}
        \begin{formula}{maximum_likelihood_estimate}
            \desc{Maximum likelihood estimate (MLE)}{Paramater for which outcome is most likely}{$L$ \fqEqRef{pt:mle:likelihood}, $\theta$ parameter of a \fqEqRef{math:pt:pdf}}
            \desc[german]{Maximum likelihood-Schätzung (MLE)}{Paramater, für den das Ergebnis am Wahrscheinlichsten ist}{$L$ \fqEqRef{math:pt:mle:likelihood}, $\theta$ Parameter einer \fqEqRef{math:pt:pdf}}
            \eq{\theta_\text{ML} &= \argmax_\theta L(\theta)\\ &= \argmax_\theta \log \big(L(\theta)\big)}
        \end{formula}

    \Subsection[
        \eng{Bayesian probability theory}
        \ger{Bayessche Wahrscheinlichkeitstheorie}
    ]{bayesian}
        \begin{formula}{prior}
            \desc{Prior distribution}{Expected distribution before conducting the experiment}{$\theta$ parameter}
            \desc[german]{Prior Verteilung}{}{}
            \eq{p(\theta)}
        \end{formula}

        \begin{formula}{evidence}
            \desc{Evidence}{}{$p(\mathcal{D}|\theta)$ \fqEqRef{math:pt:mle:likelihood}, $p(\theta)$ \fqEqRef{math:pt:bayesian:prior}, $\mathcal{D}$ data set}
            % \desc[german]{}{}{}
            \eq{p(\mathcal{D}) = \int\d\theta \,p(\mathcal{D}|\theta)\,p(\theta)}
        \end{formula}

        \begin{formula}{theorem}
            \desc{Bayes' theorem}{}{$p(\theta|\mathcal{D})$ posterior distribution, $p(\mathcal{D}|\theta)$ \fqEqRef{math:pt:mle:likelihood}, $p(\theta)$ \fqEqRef{math:pt:bayesian:prior}, $p(\mathcal{D})$ \fqEqRef{math:pt:bayesian:evidence}, $\mathcal{D}$ data set}
            \desc[german]{Satz von Bayes}{}{}
            \eq{p(\theta|\mathcal{D}) = \frac{p(\mathcal{D}|\theta)\,p(\theta)}{p(\mathcal{D})}}
        \end{formula}

        \begin{formula}{map}
            \desc{Maximum a posterior estimation (MAP)}{}{}
            % \desc[german]{}{}{}
            \eq{\theta_\text{MAP} = \argmax_\theta p(\theta|\mathcal{D}) = \argmax_\theta p(\mathcal{D}|\theta)\,p(\theta)}
        \end{formula}

