\chapter{Gaussian Identities}%
\label{cha:Gaussian Identities}
Im folgenden werden 3 Gaussian Identities genauer betrachtet
\begin{enumerate}
    \item Marginal Gaussian Distribution: die Gaußsche Normalverteilung von einem Faktor
        \begin{equation} \label{eq:marginal_gaussian_distribution}
            p(\bm x) = \nomeq{gaussian_distribution}(\bm x|\bm \mu_x,\nomeq{covariance}_{\bm x}) 
        \end{equation}
    \item Conditional Gaussian Distribution: die Gaußsche Normalverteilung des zweiten Faktors in Abhängigkeit vom ersten Faktor
        ($\bm F$: lineares Modell, dass $\bm x$ und $\bm y$ verknüpft)
        \begin{equation} \label{eq:conditional_gaussian_distribution}
            p(\bm y|\bm x) = \nomeq{gaussian_distribution}(\bm y|\bm F\bm x,\nomeq{covariance}_{\bm y}) 
        \end{equation}
    \item Joint Gaussian Distribution: Die Gaußsche Normalverteilung in Abhängigkeit von beiden Faktoren
        \begin{equation} \label{eq:joint_gaussian_distribution}
            p(\bm x,\bm y) 
            = \nomeq{gaussian_distribution}\left( \begin{bmatrix}\bm x\\ \bm y \end{bmatrix} | 
            \begin{bmatrix} \bm\mu_{\bm x} \\ \bm F\bm\mu_{\bm x} \end{bmatrix}, 
            \begin{bmatrix} 
                \nomeq{covariance}_{\bm x}      & \nomeq{covariance}_{\bm x}\bm F^T \\ 
                \bm F\nomeq{covariance}_{\bm x} & \nomeq{covariance}_{\bm y} + \bm F\nomeq{covariance}_{\bm x} \bm F^T 
            \end{bmatrix} \right)
        \end{equation}
\end{enumerate}
Es gibt zwei Richtungen,
in die umgewandelt werden kann:
\begin{enumerate}
    \item Marginal und Conditional wird zu Joint:\\
        ($\bm F$: lineares Modell, dass $\bm x$ und $\bm y$ verknüpft)
        \begin{equation} \label{eq:joint_gaussian_distribution_from_marginal_and_conditional}
            \nomeq{gaussian_distribution}(\bm x|\bm\mu_{\bm x},\nomeq{covariance}_{\bm x})\nomeq{gaussian_distribution}(\bm y|\bm F\bm x,\nomeq{covariance}_{\bm y}) 
            = \nomeq{gaussian_distribution}\left( \begin{bmatrix}\bm x\\ \bm y \end{bmatrix} | 
            \begin{bmatrix} \bm\mu_{\bm x} \\ \bm F\bm\mu_{\bm x} \end{bmatrix}, 
            \begin{bmatrix} 
                \nomeq{covariance}_{\bm x}      & \nomeq{covariance}_{\bm x}\bm F^T \\ 
                \bm F\nomeq{covariance}_{\bm x} & \nomeq{covariance}_{\bm y} + \bm F\nomeq{covariance}_{\bm x} \bm F^T 
            \end{bmatrix} \right)
        \end{equation}
    \item Joint zu Marginal und Conditional:\\
        ($C$ ist wieder eine Matrix, die eine lineare Relation zwischen $x$ und $y$ herstellt)
        \begin{equation} \label{eq:marginal_and_conditional_gaussian_distribution_from_joint}
            \nomeq{gaussian_distribution}\left( \begin{bmatrix}\bm x\\ \bm y \end{bmatrix} | 
            \begin{bmatrix} \bm\mu_{\bm x} \\ \bm\mu_{\bm y} \end{bmatrix}, 
            \begin{bmatrix} \nomeq{covariance}_{\bm x} & \bm C \\ \bm C^T & \nomeq{covariance}_{\bm y} \end{bmatrix} \right)
            = \nomeq{gaussian_distribution}(\bm x|\bm\mu_{\bm x},\nomeq{covariance}_{\bm x})
            \nomeq{gaussian_distribution}(\bm y| \bm\mu_{\bm y} + \bm C^T\nomeq{covariance}_{\bm x}^{-1}(\bm x - \bm\mu_{\bm x}), 
            \nomeq{covariance}_{\bm y} - \bm C^T\nomeq{covariance}_{\bm x}^{-1}\bm C)
        \end{equation}
\end{enumerate}

\section{Gaussian Bayes Rules}%
\label{sec:Gaussian Bayes Rules}
Es gibt zwei bayesische Regeln für die Errechnung des Posteriors:\\
(Herleitung: \cref{sec:Herleitung: Gaussian Bayes Rules})\\
Gegeben: Marginal (\cref{eq:marginal_gaussian_distribution}) und Conditional (\cref{eq:conditional_gaussian_distribution})
\begin{itemize}
    \item Gaussian Bayes Rule 1:
        \begin{itemize}
            \item Mean: \tabto{2.2cm}$\bm\mu_{\bm x|\bm y} 
                = \bm\mu_{\bm x} + \nomeq{covariance}_{\bm x}\bm F^T(\sigma_{\bm y}^2\nomeq{identity_matrix} + \bm F\nomeq{covariance}_{\bm x}\bm F^T)^{-1}(\bm y - \bm F\bm\mu_{\bm x})$
            \item Covariance:\tabto{2.2cm} $\nomeq{covariance}_{\bm x|\bm y} 
                = \nomeq{covariance}_{\bm x}-\nomeq{covariance}_{\bm x}\bm F^T(\sigma_{\bm y}^2\nomeq{identity_matrix}+\bm F\nomeq{covariance}_{\bm x}\bm F^T)^{-1}\bm F\nomeq{covariance}_{\bm x}$
        \end{itemize}
    \item Gaussian Bayes Rule 2:
        \begin{itemize}
            \item Mean: \tabto{2.2cm}$\bm\mu_{\bm x|\bm y} 
                = \bm\mu_{\bm x} + (\sigma_{\bm y}^2\nomeq{covariance}_{\bm x}^{-1} + \bm F^T\bm F)^{-1} \bm F^T (\bm y - \bm F\bm\mu_{\bm x})$
            \item Covariance:\tabto{2.2cm} $\nomeq{covariance}_{\bm x|\bm y} 
                = \sigma_{\bm y}^2(\sigma_{\bm y}^2\nomeq{covariance}_{\bm x}^{-1} + \bm F^T\bm F)^{-1}$
        \end{itemize}
\end{itemize}

\section{Gaussian Propagation}%
\label{sec:Gaussian Propagation}
Mit den Marginal und Conditional aus \cref{eq:marginal_gaussian_distribution} und \cref{eq:conditional_gaussian_distribution} ist es möglich den Conditional $p(\bm y)$ zu ermitteln:\\
(Herleitung: \cref{sec:Herleitung: Gaussian Propagation})
\begin{itemize}
    \item Mean: \tabto{2.2cm}$\bm\mu_{\bm y} = \bm F\bm\mu_{\bm x}$
    \item Covariance:\tabto{2.2cm} $\nomeq{covariance}_{\bm y} = \sigma_{\bm y}^2\nomeq{identity_matrix} + \bm F\nomeq{covariance}_{\bm x}\bm F^T$
\end{itemize}
