\documentclass[10pt]{article} 
%\usepackage{amsbsy} % for \boldsymbol and \pmb 
%\usepackage{graphicx} % To include pdf files!
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage{amsfonts}
\usepackage{euscript} % for \EuScript
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} % For links

\oddsidemargin=-.25in                  % Good for US Letter paper
\evensidemargin=0in
\textwidth=6.3in
\topmargin=-0.7in
\headheight=0.1in
\headsep=0.1in
\textheight=9.4in

\pagestyle{empty} % No page numbers

\begin{document}
\enlargethispage*{1000 pt} 


\begin{center}   
{\Large \textbf{STA 302 Formulas}}\\   % Version 2
\vspace{1 mm}
\end{center}

% Spectral decomposition, linear independence.
% MGFs
% Random vectors
% Linear model
% Distribution facts, incl x2 addup?
% Test stats and CIs


\noindent
\renewcommand{\arraystretch}{2.0}
\begin{tabular}{lll}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Univariate MGF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$M_y(t) = E(e^{yt})$ & ~~~~~ & $M_{ay}(t) = M_y(at)$ \\
$M_{y+a}(t) = e^{at}M_y(t)$ & ~~~~~ & 
$M_{_{\sum_{i=1}^n y_i}}(t) = \prod_{i=1}^n M_{y_i}(t)$
\\
$y \sim N(\mu,\sigma^2)$ means $M_{_y}(t) = e^{\mu t + \frac{1}{2}\sigma^2t^2}$
& ~~~~~ & 
$y \sim \chi^2(\nu)$ means $M_{_y}(t) = (1-2t)^{-\nu/2}$
\\
\multicolumn{3}{l}{If  $w=w_1+w_2$ with $w_1$ and $w_2$ independent, $w\sim\chi^2(\nu_1+\nu_2)$, $w_2\sim\chi^2(\nu_2)$ then $w_1\sim\chi^2(\nu_1)$} \\ 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Simple regression %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

$y_i = \beta_0 + \beta_1 x_i + \epsilon_i$
& ~~~~~ & 
$b_0 = \overline{y} - b_1\overline{x}$
\\
$b_1 = \frac{\sum_{i=1}^n(x_i-\overline{x})(y_i-\overline{y})}
           {\sum_{i=1}^n(x_i-\overline{x})^2} 
     = \frac{\sum_{i=1}^n x_iy_i - n \, \overline{x} \, \overline{y}}
            {\sum_{i=1}^n x_i^2 - n\overline{x}^2}$
& ~~~~~ & 
$r = \frac{\sum_{i=1}^n (x_i-\overline{x})(y_i-\overline{y})}
               {\sqrt{\sum_{i=1}^n (x_i-\overline{x})^2} \sqrt{\sum_{i=1}^n (y_i-\overline{y})^2}}$
\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Linear algebra %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\parbox{7 cm}{Columns of  $A$ \emph{linearly dependent} means there is a vector $\mathbf{v} \neq \mathbf{0}$ with $A\mathbf{v} = \mathbf{0}$.} & ~~~~~ &
\parbox{7 cm}{Columns of  $A$ \emph{linearly independent} means that $A\mathbf{v} = \mathbf{0}$ implies $\mathbf{v} = \mathbf{0}$.}
\\
Matrix $A$ is non-negative definite means  $\mathbf{v}^\prime A\mathbf{v} \geq 0$.
& ~~~~~ &
Matrix $A$ is  positive definite means  $\mathbf{v}^\prime A\mathbf{v} > 0$ if $\mathbf{v} \neq \mathbf{0}$.
\\
$\Sigma = CDC^\prime$
& ~~~~~ & 
$\Sigma^{-1} = CD^{-1} C^\prime$
\\
$\Sigma^{1/2} = CD^{1/2} \mathbf{C}^\prime$
& ~~~~~ &
$\Sigma^{-1/2} = CD^{-1/2} C^\prime$
\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Random vectors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$cov(\mathbf{y}) = 
E\left\{(\mathbf{y}-\boldsymbol{\mu}_y)(\mathbf{y}-\boldsymbol{\mu}_y)^\prime\right\}$ 
& ~~~~~ & 
$cov(\mathbf{y,t}) = E\left\{ (\mathbf{y}-\boldsymbol{\mu}_y)
                             (\mathbf{t}-\boldsymbol{\mu}_t)^\prime\right\}$
\\
$cov(A\mathbf{y}) = A \, cov(\mathbf{y}) A^\prime$
& ~~~~~ &
$cov(A\mathbf{y},B\mathbf{y}) = A \, cov(\mathbf{y}) B^\prime$
\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multivariate MGF, MVN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

$M_{\mathbf{y}}(\mathbf{t}) = E(e^{\mathbf{t}^\prime\mathbf{y}})$ 
& ~~~~~ & 
$M_{A\mathbf{y}}(\mathbf{t}) = M_{\mathbf{y}}(A^\prime\mathbf{t})$
\\
$M_{\mathbf{y}+\mathbf{c}}(\mathbf{t}) = e^{\mathbf{t}^\prime\mathbf{c}} M_{\mathbf{y}}(\mathbf{t})$
 & ~~~~~ & 
$\mathbf{y} \sim N_p(\boldsymbol{\mu}, \Sigma)$ means $M_{\mathbf{y}}(\mathbf{t}) = e^{\mathbf{t}^\prime\boldsymbol{\mu} + \frac{1}{2} \mathbf{t}^\prime \Sigma \mathbf{t}}$
\\
\multicolumn{3}{l}{$\mathbf{y}_1$ and $\mathbf{y}_2$ are independent if and only if
$M_{(\mathbf{y}_1,\mathbf{y}_2)}\left(\mathbf{t}_1,\mathbf{t}_2\right)
= M_{\mathbf{y}_1}(\mathbf{t}_1) M_{\mathbf{y}_2}(\mathbf{t}_2)$} \\
If $\mathbf{y} \sim N_p(\boldsymbol{\mu}, \Sigma)$, then $A\mathbf{y} + \mathbf{c} \sim N_q(A\boldsymbol{\mu}+\mathbf{c}, A\Sigma A^\prime)$,
 & ~~~~~ &
and $w = (\mathbf{y}-\boldsymbol{\mu})^\prime
           \Sigma^{-1}(\mathbf{y}-\boldsymbol{\mu}) \sim \chi^2(p)$
\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Regression (normal next time) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$y_i = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_k x_{ik} + \epsilon_i$
& ~~~~~ & 
$\epsilon_1, \ldots, \epsilon_n$ independent $N(0,\sigma^2)$
\\
$\mathbf{y} = X \boldsymbol{\beta} + \boldsymbol{\epsilon}$ with $\boldsymbol{\epsilon} \sim N(\mathbf{0},\sigma^2I_n)$
& ~~~~~ &
$\mathbf{b} = (X^\prime X)^{-1} 
                   X^\prime \mathbf{y} \sim N_{k+1}\left(\boldsymbol{\beta},\sigma^2(X^\prime X)^{-1}\right)$
\\
$\widehat{\mathbf{y}} = X\mathbf{b} = H\mathbf{y}$, where 
$H = X(X^\prime X)^{-1} 
                   X^\prime $
& ~~~~~ &
$\mathbf{e} = \mathbf{y} - \widehat{\mathbf{y}} = (I-H)\mathbf{y}$ 
\\
$\mathbf{b}$ and $\mathbf{e}$ are independent under normality.
& ~~~~~ &
$\frac{SSE}{\sigma^2} = \frac{\mathbf{e}^\prime \mathbf{e}}{\sigma^2}  \sim \chi^2(n-k-1)$ 
\\
$\sum_{i=1}^n(y_i-\overline{y})^2 = \sum_{i=1}^n(y_i-\widehat{y}_i)^2 + \sum_{i=1}^n(\widehat{y}_i-\overline{y})^2$
& ~~~~~ &
$SST=SSE+SSR$ and $R^2 = \frac{SSR}{SST}$
\\
$t = \frac{Z}{\sqrt{W/\nu}} \sim t(\nu)$
& ~~~~~ &
$F = \frac{W_1/\nu_1}{W_2/\nu_2} \sim F(\nu_1,\nu_2)$
\\
$t = \frac{\boldsymbol{\ell}^\prime \mathbf{b}-\boldsymbol{\ell}^\prime \boldsymbol{\beta}}
             {s \sqrt{ \boldsymbol{\ell}^\prime 
             (X^\prime X)^{-1}\boldsymbol{\ell}}} \sim t(n-k-1)$
& ~~~~~ &
$\boldsymbol{\ell}^\prime \mathbf{b} \pm t_{\alpha/2} \, s \sqrt{ \boldsymbol{\ell}^\prime 
             (X^\prime X)^{-1}\boldsymbol{\ell}}$
\\
$F^* = \frac{(\mathbf{C}\mathbf{b}-\boldsymbol{\gamma})^\prime
            (\mathbf{C}(\mathbf{X}^\prime \mathbf{X})^{-1}\mathbf{C}^\prime)^{-1}
            (\mathbf{C}\mathbf{b}-\boldsymbol{\gamma})}
           {m \, s^2} \stackrel{H_0}{\sim} F(m,n-k-1)$
& ~~~~~ &
$F^* = \frac{SSR_F-SSR_R}{m \, s^2} = 
        \left( \frac{n-k-1}{m}  \right) \left( \frac{a}{1-a} \right)$
\\
$s^2 = \frac{SSE}{n-k-1} = \frac{\mathbf{e}^\prime \mathbf{e}}{n-k-1}$
& ~~~~~ &
$a = \frac{R^2_F-R^2_R}{1-R^2_R} = \frac{mF}{n-k-1+mF}$
\\
$t = \frac{y_0 - \mathbf{x}_0^\prime \mathbf{b}}
             {s \sqrt{1+\mathbf{x}_0^\prime 
             (X^\prime X)^{-1}\mathbf{x}_0}} \sim t(n-k-1)$
& ~~~~~ &
$\mathbf{x}_0^\prime \mathbf{b} \pm t_{\alpha/2} \, s \sqrt{1+\mathbf{x}_0^\prime 
             (X^\prime X)^{-1}\mathbf{x}_0}$
\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{tabular}
\renewcommand{\arraystretch}{1.0}
\begin{center}\begin{tabular}{l}
\hspace{6.5in} \\ \hline
\end{tabular}\end{center}
This formula sheet was prepared by  \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner},
Department of Statistics, 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:
\begin{center}
\href{http://www.utstat.toronto.edu/~brunner/oldclass/302f17} {\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/302f17}}
\end{center}


\end{document}

% Next time: Prediction interval
$t = \frac{y_0 - \mathbf{x}_0^\prime \mathbf{b}}
             {s \sqrt{1+\mathbf{x}_0^\prime 
             (X^\prime X)^{-1}\mathbf{x}_0}} \sim t(n-k-1)$
& ~~~~~ &
$\mathbf{x}_0^\prime \mathbf{b} \pm t_{\alpha/2} \, s \sqrt{1+\mathbf{x}_0^\prime 
             (X^\prime X)^{-1}\mathbf{x}_0}$
\\



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

& ~~~~~ &
\\


