% \documentclass[serif]{beamer} % Serif for Computer Modern math font. \documentclass[serif, handout]{beamer} % Handout to ignore pause statements \hypersetup{colorlinks,linkcolor=,urlcolor=red} \usefonttheme{serif} % Looks like Computer Modern for non-math text -- nice! \setbeamertemplate{navigation symbols}{} % Suppress navigation symbols % \usetheme{Berlin} % Displays sections on top \usetheme{Frankfurt} % Displays section titles on top: Fairly thin but still swallows some material at bottom of crowded slides %\usetheme{Berkeley} \usepackage[english]{babel} \usepackage{amsmath} % for binom % \usepackage{graphicx} % To include pdf files! % \definecolor{links}{HTML}{2A1B81} % \definecolor{links}{red} \setbeamertemplate{footline}[frame number] \mode \title{Random Vectors\footnote{See last slide for copyright information.}} \subtitle{STA 302 Fall 2015} \date{} % To suppress date \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame} \frametitle{Random Vectors and Matrices} \framesubtitle{See Chapter 3 of \emph{Linear models in statistics} for more detail.} A \emph{random matrix} is just a matrix of random variables. Their joint probability distribution is the distribution of the random matrix. Random matrices with just one column (say, $p \times 1$) may be called \emph{random vectors}. \end{frame} \begin{frame} \frametitle{Expected Value} %\framesubtitle{} The expected value of a matrix is defined as the matrix of expected values. Denoting the $p \times c$ random matrix $\mathbf{X}$ by $[X_{i,j}]$, \begin{displaymath} E(\mathbf{X}) = [E(X_{i,j})]. \end{displaymath} \end{frame} \begin{frame} \frametitle{Immediately we have natural properties like} %\framesubtitle{} \begin{eqnarray*} E(\mathbf{X}+\mathbf{Y}) &=& \pause E([X_{i,j}+Y_{i,j}]) \\ \pause &=& [E(X_{i,j}+Y_{i,j})] \\ \pause &=& [E(X_{i,j})+E(Y_{i,j})] \\ \pause &=& [E(X_{i,j})]+[E(Y_{i,j})] \\ \pause &=& E(\mathbf{X})+E(\mathbf{Y}). \end{eqnarray*} \end{frame} \begin{frame} \frametitle{Moving a constant matrix through the expected value sign} \pause Let $\mathbf{A} = [a_{i,j}]$ be an $r \times p$ matrix of constants, while $\mathbf{X}$ is still a $p \times c$ random matrix. Then \pause \begin{eqnarray} E(\mathbf{AX}) &=& E\left(\left[\sum_{k=1}^p a_{i,k}X_{k,j}\right]\right) \nonumber \\ \pause &=& \left[E\left(\sum_{k=1}^p a_{i,k}X_{k,j}\right)\right] \nonumber \\ \pause &=& \left[\sum_{k=1}^p a_{i,k}E(X_{k,j})\right] \nonumber \\ \pause &=& \mathbf{A}E(\mathbf{X}). \nonumber \end{eqnarray} \pause Similar calculations yield $E(\mathbf{AXB}) = \mathbf{A}E(\mathbf{X})\mathbf{B}$. \end{frame} \begin{frame} \frametitle{Variance-Covariance Matrices} Let $\mathbf{X}$ be a $p \times 1$ random vector with $E(\mathbf{X}) = \boldsymbol{\mu}$. The \emph{variance-covariance matrix} of $\mathbf{X}$ (sometimes just called the \emph{covariance matrix}), denoted by $cov(\mathbf{X})$, is defined as \begin{displaymath} cov(\mathbf{X}) = E\left\{ (\mathbf{X}-\boldsymbol{\mu}) (\mathbf{X}-\boldsymbol{\mu})^\prime\right\}. \end{displaymath} \end{frame} \begin{frame} \frametitle{$cov(\mathbf{X}) = E\left\{ (\mathbf{X}-\boldsymbol{\mu}) (\mathbf{X}-\boldsymbol{\mu})^\prime\right\}$} \pause \begin{columns} % Use Beamer's columns to use more of the margins! \column{1.1\textwidth} {\scriptsize \begin{eqnarray*} cov(\mathbf{X}) &=& E\left\{ \left( \begin{array}{c} X_1-\mu_1 \\ X_2-\mu_2 \\ X_3-\mu_3 \end{array} \right) \left( \begin{array}{c c c} X_1-\mu_1 & X_2-\mu_2 & X_3-\mu_3 \end{array} \right) \right\} \\ \pause &=& E\left\{ \left( \begin{array}{l l l} (X_1-\mu_1)^2 & (X_1-\mu_1)(X_2-\mu_2) & (X_1-\mu_1)(X_3-\mu_3) \\ (X_2-\mu_2)(X_1-\mu_1) & (X_2-\mu_2)^2 & (X_2-\mu_2)(X_3-\mu_3) \\ (X_3-\mu_3)(X_1-\mu_1) & (X_3-\mu_3)(X_2-\mu_2) & (X_3-\mu_3)^2 \\ \end{array} \right) \right\} \\ \pause \nonumber \\ &=& \left( \begin{array}{l l l} E\{(X_1-\mu_1)^2\} & E\{(X_1-\mu_1)(X_2-\mu_2)\} & E\{(X_1-\mu_1)(X_3-\mu_3)\} \\ E\{(X_2-\mu_2)(X_1-\mu_1)\} & E\{(X_2-\mu_2)^2\} & E\{(X_2-\mu_2)(X_3-\mu_3)\} \\ E\{(X_3-\mu_3)(X_1-\mu_1)\} & E\{(X_3-\mu_3)(X_2-\mu_2)\} & E\{(X_3-\mu_3)^2\} \\ \end{array} \right) \\ \pause \nonumber \\ &=& \left( \begin{array}{l l l} Var(X_1) & Cov(X_1,X_2) & Cov(X_1,X_3) \\ Cov(X_1,X_2) & Var(X_2) & Cov(X_2,X_3) \\ Cov(X_1,X_3) & Cov(X_2,X_3) & Var(X_3) \\ \end{array} \right) . \\ \pause \nonumber \end{eqnarray*} So, the covariance matrix $cov(\mathbf{X})$ is a $p \times p$ symmetric matrix with variances on the main diagonal and covariances on the off-diagonals. }% End size \end{columns} \end{frame} \begin{frame} \frametitle{Analogous to $Var(a\,X) = a^2\,Var(X)$} \pause Let $\mathbf{X}$ be a $p \times 1$ random vector with $E(\mathbf{X}) = \boldsymbol{\mu}$ and $cov(\mathbf{X}) = \boldsymbol{\Sigma}$, while $\mathbf{A} = [a_{i,j}]$ is an $r \times p$ matrix of constants. Then \pause \begin{eqnarray*} cov(\mathbf{AX}) &=& \pause E\left\{ (\mathbf{AX}-\mathbf{A}\boldsymbol{\mu}) (\mathbf{AX}-\mathbf{A}\boldsymbol{\mu})^\prime \right\} \\ \pause &=& E\left\{ \mathbf{A}(\mathbf{X}-\boldsymbol{\mu}) \left(\mathbf{A}(\mathbf{X}-\boldsymbol{\mu})\right)^\prime \right\} \\ \pause &=& E\left\{ \mathbf{A}(\mathbf{X}-\boldsymbol{\mu}) (\mathbf{X}-\boldsymbol{\mu})^\prime \mathbf{A}^\prime \right\} \nonumber \\ \pause &=& \mathbf{A}E\{(\mathbf{X}-\boldsymbol{\mu}) (\mathbf{X}-\boldsymbol{\mu})^\prime\} \mathbf{A}^\prime \\ \pause &=& \mathbf{A}cov(\mathbf{X}) \mathbf{A}^\prime \nonumber \\ &=& \mathbf{A}\boldsymbol{\Sigma}\mathbf{A}^\prime \end{eqnarray*} \end{frame} \begin{frame} \frametitle{Positive definite is a natural assumption} \framesubtitle{For covariance matrices} \pause \begin{itemize} \item $cov(\mathbf{X}) = \boldsymbol{\Sigma}$ \pause \item $\boldsymbol{\Sigma}$ positive definite means $\mathbf{a}^\prime \boldsymbol{\Sigma} \mathbf{a} > 0$. for all $\mathbf{a} \neq \mathbf{0}$. \pause \item $Y = \mathbf{a}^\prime \mathbf{X} = a_1X_1 + \cdots + a_p X_p$ is a scalar random variable. \pause \item $Var(Y) = \mathbf{a}^\prime cov(\mathbf{X}) \mathbf{a} \pause = \mathbf{a}^\prime \boldsymbol{\Sigma} \mathbf{a}$ \pause \item $\boldsymbol{\Sigma}$ positive definite just says that the variance of any (non-trivial) linear combination is positive. \pause \item This is often what you want (but not always). \end{itemize} \end{frame} \begin{frame} \frametitle{Matrix of covariances between two random vectors} \pause Let $\mathbf{X}$ be a $p \times 1$ random vector with $E(\mathbf{X}) = \boldsymbol{\mu}_x$ and let $\mathbf{Y}$ be a $q \times 1$ random vector with $E(\mathbf{Y}) = \boldsymbol{\mu}_y$. \pause \vspace{3mm} The $p \times q$ matrix of covariances between the elements of $\mathbf{X}$ and the elements of $\mathbf{Y}$ is \pause \begin{displaymath} C(\mathbf{X,Y}) = E\left\{ (\mathbf{X}-\boldsymbol{\mu}_x) (\mathbf{Y}-\boldsymbol{\mu}_y)^\prime\right\}. \end{displaymath} \end{frame} \begin{frame} \frametitle{Adding a constant has no effect} \framesubtitle{On variances and covariances} \pause It's clear from the definitions \begin{itemize} \item $cov(\mathbf{X}) = E\left\{ (\mathbf{X}-\boldsymbol{\mu}) (\mathbf{X}-\boldsymbol{\mu})^\prime\right\}$ \item $C(\mathbf{X,Y}) = E\left\{ (\mathbf{X}-\boldsymbol{\mu}_x) (\mathbf{Y}-\boldsymbol{\mu}_y)^\prime\right\}$ \end{itemize} \pause That \begin{itemize} \item $ cov(\mathbf{X} + \mathbf{a}) = cov(\mathbf{X})$ \pause \item $C(\mathbf{X} + \mathbf{a},\mathbf{Y} + \mathbf{b}) \pause = C(\mathbf{X},\mathbf{Y})$ \end{itemize} \vspace{5mm} \pause For example, $E(\mathbf{X} + \mathbf{a}) = \boldsymbol{\mu} + \mathbf{a}$, so \pause \begin{eqnarray*} cov(\mathbf{X} + \mathbf{a}) & = & E\left\{ (\mathbf{X}+\mathbf{a}-(\boldsymbol{\mu}+\mathbf{a})) (\mathbf{X}+\mathbf{a}-(\boldsymbol{\mu}+\mathbf{a}))^\prime\right\} \\ \pause & = & E\left\{ (\mathbf{X}-\boldsymbol{\mu}) (\mathbf{X}-\boldsymbol{\mu})^\prime\right\} \\ \pause & = & cov(\mathbf{X}) \end{eqnarray*} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Copyright Information} This slide show was prepared by \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner}, Department of Statistical Sciences, University of Toronto. It is licensed under a \href{http://creativecommons.org/licenses/by-sa/3.0/deed.en_US} {Creative Commons Attribution - ShareAlike 3.0 Unported License}. Use any part of it as you like and share the result freely. The \LaTeX~source code is available from the course website: \href{http://www.utstat.toronto.edu/~brunner/oldclass/302f15} {\small\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/302f15}} \end{frame} \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{} %\framesubtitle{} \begin{itemize} \item \item \item \end{itemize} \end{frame} {\LARGE \begin{displaymath} \end{displaymath} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%