class: center, middle, inverse, title-slide # Properties of random matrices ### Dr. D’Agostino McGowan --- layout: true <div class="my-footer"> <span> Dr. Lucy D'Agostino McGowan </span> </div> --- ## Random matrices * `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ -- .question[ What do I mean by a _random matrix_? ] -- * A _random matrix_ is a matrix consisting of a _random variable_ (as opposed to a _constant_). --- ## Random matrices * `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ -- * `\(\mathbf{A}\)` and `\(\mathbf{B}\)` are _constant matrices_. --- ## Expectation * **Expectation** describes the _average value_ -- * In math-speak, we write it like this `\(E[X]\)` -- * Recall from probability, `$$E[X] = \begin{cases} \sum_x xp_X(x) & X \textrm{ is a discrete random variable}\\ \int_{-\infty}^{\infty}xf_X(x)dx & X \textrm{ is a continuous random variable} \end{cases}$$` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-16 328c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160zm112 0c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160z"/></svg> `Expectation facts` .definition[ `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ `\(\mathbf{A}\)` and `\(\mathbf{B}\)` are _constant matrices_ ] * `\(E[\mathbf{X} + \mathbf{Y}] = E[\mathbf{X}] + E[\mathbf{Y}]\)` -- * `\(E[\mathbf{AX}] = \mathbf{A}E[\mathbf{X}]\)` -- * `\(E[\mathbf{A}\mathbf{X}\mathbf{B}] = \mathbf{A}E[\mathbf{X}]\mathbf{B}\)` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` .definition[ a is a constant, `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are a random matrices ] Solve the following: * `\(E[a\mathbf{X}]\)` * `\(E[\mathbf{X} + \mathbf{Y}]\)` * `\(E[\mathbf{X}\mathbf{Y}]\)`
01
:
30
--- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` .definition[ a is a constant, `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are a random matrices ] Solve the following: * `\(E[a\mathbf{X}] = aE[\mathbf{X}]\)` * `\(E[\mathbf{X} + \mathbf{Y}] = E[\mathbf{X}] + E[\mathbf{Y}]\)` * `\(E[\mathbf{X}\mathbf{Y}]= ?\)` --- ## Covariance * **Covariance** is a measure of _joint variability_ between two random variables -- * In math-speak we write it like this: `\(cov(\mathbf{X},\mathbf{Y})\)` -- * Recall from probability, `$$cov(\mathbf{X},\mathbf{Y}) = E[(\mathbf{X} - E[\mathbf{X}])(\mathbf{Y} - E[\mathbf{Y}])]$$` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-16 328c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160zm112 0c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160z"/></svg> `Covariance facts` .definition[ `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ `\(\mathbf{A}\)` and `\(\mathbf{B}\)` are _constant matrices_ `\(c\)` and `\(d\)` are _constants_ ] * `\(cov(\mathbf{X},\mathbf{Y}) = cov(\mathbf{Y}^T, \mathbf{X})\)` -- * `\(cov(\mathbf{X} + c, \mathbf{Y} + d) = cov(\mathbf{X}, \mathbf{Y}) + cov(\mathbf{X}, d) + cov(c, \mathbf{Y}) + cov(c, d)\)` -- .question[ What is the covariance between an random variable and a constant? ] -- * `\(cov(\mathbf{X} + c, \mathbf{Y} + d) = cov(\mathbf{X}, \mathbf{Y}) + 0 + 0 + 0 = cov(\mathbf{X}, \mathbf{Y})\)` -- * `\(cov(\mathbf{A}\mathbf{X}, \mathbf{B}\mathbf{Y}) = \mathbf{A}cov(\mathbf{X}, \mathbf{Y})\mathbf{B}^T\)` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` .definition[ `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ `\(\mathbf{A}\)` and `\(\mathbf{B}\)` are _constant matrices_ `\(c\)` and `\(d\)` are _constants_ ] Calculate the covariance of the following: * `\(cov(\mathbf{B}\mathbf{X}, \mathbf{Y})\)` * `\(cov(c, \mathbf{Y})\)`
01
:
30
--- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` .definition[ `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ `\(\mathbf{A}\)` and `\(\mathbf{B}\)` are _constant matrices_ `\(c\)` and `\(d\)` are _constants_ ] Calculate the covariance of the following: * `\(cov(\mathbf{B}\mathbf{X}, \mathbf{Y}) = \mathbf{B}cov(\mathbf{X}, \mathbf{Y})\)` * `\(cov(c, \mathbf{Y}) = 0\)` --- ## Variance * **Variance** measures the spread of a variable -- * In math-speak, we write it like this: `\(var(\mathbf{X})\)` -- * Recall from probability, `$$var(\mathbf{X}) = cov(\mathbf{X}, \mathbf{X}) = E[\mathbf{X}^2] - E[\mathbf{X}]^2$$` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-16 328c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160zm112 0c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160z"/></svg> `Variance facts` .definition[ `\(\mathbf{X}\)` and `\(\mathbf{Y}\)` are _random matrices_ `\(\mathbf{A}\)` and `\(\mathbf{B}\)` are _constant matrices_ `\(c\)` and `\(d\)` are _constants_ ] * `\(var(\mathbf{X} + c) = var(\mathbf{X})\)` -- * `\(var(\mathbf{A}\mathbf{X}) = \mathbf{A}var(\mathbf{X})\mathbf{A}^T\)` -- * If `\(X_i\)`s are independent, `\(var(\sum_{i=1}^n X_i) = \sum var(X_i)\)` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` Show that `\(cov(\mathbf{X}, \mathbf{X}) = var(\mathbf{X})\)`
03
:
00
--- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` Show that `\(cov(\mathbf{X}, \mathbf{X}) = var(\mathbf{X})\)` `$$\begin{align} cov(\mathbf{X}, \mathbf{X}) & = E[(\mathbf{X} - E[\mathbf{X}])(\mathbf{X} - E[\mathbf{X}])] \end{align}$$` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` Show that `\(cov(\mathbf{X}, \mathbf{X}) = var(\mathbf{X})\)` `$$\begin{align} cov(\mathbf{X}, \mathbf{X}) & = E[(\mathbf{X} - E[\mathbf{X}])(\mathbf{X} - E[\mathbf{X}])]\\ & = E[\mathbf{X}^2-2\mathbf{X}E[\mathbf{X}]+E[\mathbf{X}]^2] \end{align}$$` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` Show that `\(cov(\mathbf{X}, \mathbf{X}) = var(\mathbf{X})\)` `$$\begin{align} cov(\mathbf{X}, \mathbf{X}) & = E[(\mathbf{X} - E[\mathbf{X}])(\mathbf{X} - E[\mathbf{X}])]\\ & = E[\mathbf{X}^2-2\mathbf{X}E[\mathbf{X}]+E[\mathbf{X}]^2]\\ &= E[\mathbf{X}^2] - 2E[\mathbf{X}]E[\mathbf{X}]+E[\mathbf{X}]^2 \end{align}$$` --- ## <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg> `Try it` Show that `\(cov(\mathbf{X}, \mathbf{X}) = var(\mathbf{X})\)` `$$\begin{align} cov(\mathbf{X}, \mathbf{X}) & = E[(\mathbf{X} - E[\mathbf{X}])(\mathbf{X} - E[\mathbf{X}])]\\ & = E[\mathbf{X}^2-2\mathbf{X}E[\mathbf{X}]+E[\mathbf{X}]^2]\\ &= E[\mathbf{X}^2] - 2E[\mathbf{X}]E[\mathbf{X}]+E[\mathbf{X}]^2\\ &=E[\mathbf{X}^2] - E[\mathbf{X}]^2 \end{align}$$` --- ## Unbiased .question[ What does it mean to be unbiased? ] -- If `\(X\)` is a statistic used to estimate a parameter `\(\theta\)`, it is _unbiased_ if `$$E[X] = \theta$$`