
STAT3530 Fall 2026
I’m Trevor. This is how I got here.
Note to self: go over syllabus.
We have a small group so let’s do icebreakers:
Two properties of linear trends:
Note trends in each row are identical.

Measures direction and strength of linear relationship.
\[r = \frac{\sum_i (x_i - \bar{x})(y_i - \bar{y})}{(n-1) \times s_x \times s_y}\]

Correlation only measures the strength of linear relationships.
More on nonlinear relationships later.

Measures nonverbal fluency and executive cognitive function on 0-175 scale.
Data from \(n = 208\) observations show:

\[\text{Model:}\qquad\text{RFFT}_i = \beta_0 + \beta_1 \text{age}_i + \epsilon_i \quad\text{for}\quad i = 1, \dots, 208\]
To “fit” this model, we need to find values for the regression coefficients \(\beta_0, \beta_1\).
None of these are good. Why not?
The residuals are too big. Smaller is better.
Rewrite the model in the form \[Y_i = \beta_0 + \beta_1 x_i + \epsilon_i\,, \qquad i = 1, \dots, 208\]
Given estimates \(\hat\beta_0, \hat\beta_1\), the residuals are \(\color{red}{e_i} = Y_i - \hat\beta_0 - \hat\beta_1 x_i\). So we minimize: \[SSE(\beta_0, \beta_1) = \sum_{i = 1}^n \left( Y_i - \beta_0 - \beta_1 x_i \right)^2\] Analytic solution:
\[\begin{align*} 0 &= \frac{d}{d\beta_0} \sum_{i = 1}^n \left( Y_i - \beta_0 - \beta_1 x_i \right)^2 = \cdots [\text{HW1}] \cdots \Rightarrow \hat\beta_0 = \bar{Y} - \beta_1 \bar{x} \\ 0 &= \frac{d}{d\beta_1} \sum_{i = 1}^n \left( [Y_i - \bar{Y}] - \beta_1 [x_i - \bar{x}] \right)^2 = \cdots [\text{HW1}] \cdots \Rightarrow \hat\beta_1 = r\frac{s_y}{s_x} \end{align*}\]
Handout Q5
lm() in R
Call:
lm(formula = rfft ~ age, data = prevend)
Coefficients:
(Intercept) age
134.098 -1.191
This says the least squares estimates are

Handout Q6
Since the model errors \(\epsilon_1, \dots, \epsilon_n\) are random, we don’t estimate them.
The line represents an average; it is obviously false as a description of the observations.
Parameter interpretations:
For the RFFT model:
Call:
lm(formula = dist ~ speed, data = cars)
Coefficients:
(Intercept) speed
-17.579 3.932
[1] 15.37959
First identify:
Then interpret the estimates.

Handout Q7
So now we have:
In 3530 we will cover a variety of topics in connection with the general linear model
\[Y = X\beta + \epsilon\]
where each term is a vector or matrix.
Provides a certain elegance.
On that last point, note that with a little algebra we get:
\[\hat\beta_1 = \sum_{i=1}^n \underbrace{\frac{x_i - \bar{x}}{(n-1)s^2_x}}_{w_i} \, Y_i = \sum_{i=1}^n w_i Y_i = w^T Y \]
More detail later, but the least squares estimates are linear functions of the response \(Y\).
An \(n\)-dimensional vector is a column of numbers
\[a = \left[\begin{array}{c} a_1 \\ \vdots \\ a_n \end{array}\right]\]
If its entries are real numbers we write \(a \in \mathbb{R}^n\).
For example, consider:
\[a = \left[\begin{array}{c} -1 \\ 0 \\ 2 \end{array}\right]\]
Your turn: \(a \in \hspace{1em}\)
Handout Q8
If \(a, b \in \mathbb{R}^n\) their inner product is the sum of the product of their entries:
\[\langle a, b \rangle = \sum_{i = 1}^n a_i \, b_i\]
For example, given
\[a = \left[\begin{array}{c} -1 \\ 0 \\ 2\end{array}\right],\quad b = \left[\begin{array}{c} 3 \\ 5 \\ 6\end{array}\right]\] The inner product is \[\langle a, b \rangle = (-1\cdot3) + (0\cdot5) + (2\cdot6) = 9 \]
Handout Q8
An \(n \times m\) matrix is an array of numbers
\[A = \left[\begin{array}{cccc} a_{11} &a_{12} &\cdots &a_{1m} \\ a_{21} &a_{22} &\cdots &a_{2m} \\ \vdots &\vdots &\ddots &\vdots \\ a_{n1} &a_{n2} &\cdots &a_{nm} \end{array}\right]\]
We sometimes write \(A_{n\times m}\) to indicate the dimensions explicitly and \(A = \{a_{ij}\}\) to indicate the indexing explicitly. If its entries are real numbers we write \(A \in \mathbb{R}^{n\times m}\).
For example:
\[A = \left[\begin{array}{ccc} 1 &0 &3\\ 4 &-2 &0 \end{array}\right]\]
Your turn: \(A \in \hspace{1em}\) and \(A_{\hspace{1em}\times\hspace{1em}}\)
Handout Q9
If \(A = \{a_{ij}\}\) is a matrix, its transpose is \(A^T = \{a_{ji}\}\). For example:
\[A = \left[\begin{array}{ccc} 1 &0 &3\\ 4 &-2 &0 \end{array}\right],\qquad A^T = \left[\begin{array}{cc} 1 &4 \\ 0 &-2 \\ 3 &0 \end{array}\right]\]
Observe that vectors are matrices with column dimension 1. If
\[a = \left[\begin{array}{c} a_1 \\ \vdots \\ a_n \end{array}\right]\] then \(a\) is an \(n \times 1\) matrix. Its transpose is the \(1 \times n\) matrix
\[a^T = \left[\begin{array}{ccc} a_1 &\cdots &a_n \end{array}\right]\] which we call an \(n-\)dimensional row vector.
We can write a matrix in terms of its columns or in terms of its rows. For example, if
\[A = \left[\begin{array}{ccc} 1 &0 &3\\ 4 &-2 &0 \end{array}\right]\]
then we can write either the column representation
\[A = \left[\begin{array}{ccc} a_1 &a_2 &a_3 \end{array}\right] \quad\text{where}\quad a_1 = \left[\begin{array}{c} 1 \\ 4 \end{array}\right],\, a_2 = \left[\begin{array}{c} 0 \\ -2 \end{array}\right],\, a_3 = \left[\begin{array}{c} 3 \\ 0 \end{array}\right]\]
or the row representation
\[A = \left[\begin{array}{c} a_1^T \\ a_2^T \end{array}\right] \quad\text{where}\quad a_1^T = \left[\begin{array}{ccc} 1 &0 &3 \end{array}\right] \quad\text{and}\quad a_2^T = \left[\begin{array}{ccc} 4 &-2 &0 \end{array}\right]\]
If \(A_{n\times m}, B_{m\times p}\) are matrices, their product is the \(n \times p\) matrix with \((i,j)\)th entry \[AB = \left\{ \sum_{k=1}^m a_{ik} b_{kj} \right\} = \left\{ a_i^Tb_j\right\}\]
Note that \(a_i^T b_j\) is the inner product of the \(i\)th row of \(A\) with the \(j\)th column of \(B\).
For example, \[\underbrace{\left[\begin{array}{ccc} \color{blue}{1} &\color{blue}{0} &\color{blue}{3}\\ 4 &-2 &0 \end{array}\right]}_A\, \underbrace{\left[\begin{array}{cc} \color{blue}{0} &1 \\ \color{blue}{-1} &2 \\ \color{blue}{1} &0 \end{array}\right]}_{B} = \underbrace{\left[\begin{array}{cc} \color{blue}{3} &1 \\ 2 &0 \end{array}\right]}_{AB}\] Your turn: what is the \((1,1)\) entry of \(BA\)?
Handout Q10
\(AB\) exists just in case column dimension of \(A\) = row dimension of \(B\).
So if \(A_{3\times 2}, B_{3\times 4}\) are matrices then:
In fact, one can check that \(A^T B\) and \(B^T A\) are transposes. In general, one has that \[(AB)^T = \left(B^TA^T\right)\] whenever the product exists.
Handout Q10
An \(n \times n\) matrix (same row and column dimensions) is called “square”.
A square matrix \(A\) is:
An identity matrix is a square matrix with ones along the diagonal: \[I_n = \left[\begin{array}{cccc} 1 &0 &\cdots &0 \\ 0 &1 &\cdots &0 \\ \vdots &\vdots &\ddots &\vdots \\ 0 &0 &\cdots &1 \end{array}\right]\] We usually write \(I\) plainly as dimensions are typically clear from context. It is called the identity matrix because, for any \(A_{n\times m}\), we have \(I_n A = A\) and \(AI_m = A\).
For a square matrix \(A_{n\times n}\), the inverse \(A^{-1}\) is the matrix satisfying \[AA^{-1} = A^{-1}A = I\] if it exists. If so, we say \(A\) is “invertible”.
Note the definition implies that \((A^T)^{-1} = (A^{-1})^T\).
Vectors \(a_1, \dots, a_m \in \mathbb{R}^n\) are linearly independent if \[c_1 a_1 + c_2 a_2 + \cdots + c_m a_m = 0 \quad\Longrightarrow\quad c_1 = c_2 = \cdots = c_m = 0\]
For example, if \[A = \left[\begin{array}{ccc} 1 &0 &3\\ 4 &-2 &0 \end{array}\right]\] the columns are not independent since \[-3\left[\begin{array}{c} 1 \\ 4\end{array}\right] -6\left[\begin{array}{c} 0 \\ -2\end{array}\right] +\left[\begin{array}{c} 3 \\ 0\end{array}\right] = \left[\begin{array}{c} 0 \\ 0\end{array}\right] \qquad\text{that is,}\qquad a_3 = 3a_1 + 6a_2\]
Your turn: are \(a_1, a_3\) independent?
Handout Q12
If \(A \in \mathbb{R}^{n\times m}\), its column space is the linear subspace spanned by its columns \[\text{span}(a_1, \dots, a_m) = \left\{ c_1 a_1 + \cdots + c_m a_m \;:\; c_1, \dots, c_m \in \mathbb{R} \right\}\]
with dimension equal to the number of linearly independent columns.
The rank of \(A\) is the dimension of its column space \[\text{rank}(A) = \dim \left( \text{span}(a_1, \dots, a_m) \right)\] We always have \(\text{rank}(A) \leq \min(n, m)\); when equality holds we say \(A\) is “full rank”.
Consider again \[A = \left[\begin{array}{ccc} 1 &0 &3\\ 4 &-2 &0 \end{array}\right]\] Your turn: What is the rank of \(A\)? Is it full rank?
Handout Q12
Variable: a term that takes different values.
Random variable: one whose values depend on chance.
An RV’s distribution describes the observation frequency of each value.

Measurements from a random sample = repeated independent observations of an RV
Distribution becomes a model for the data.
Formally, we write
\[Y_1, \dots, Y_{208} \stackrel{iid}{\sim} F\]
where
\[Y_i = i\text{th RFFT measurement}\]
to mean the measurements are independent and identically distributed (i.i.d.) RVs with common distribution \(F\).

Distributions have a center and spread, just like data from a sample.
For an RV \(Y \sim F\), define
Functions of random variables are themselves random variables. Fun facts:
Your turn: if \(\mathbb{E}[Y] = 2\), what is \(\mathbb{E}[3Y + 5]\)? What about \(\text{Var}[3Y + 5]\)?
Handout Q13
Those red curves are normal distributions.
We write
\[Y \sim N(\mu, \sigma^2)\]
to mean \(Y\) is normally distributed with
Useful fact: \[aY + b \sim N(a\mu + b, a^2\sigma^2)\]

Your turn: if \(Y \sim N(\mu, \sigma^2)\), then \(Y - \mu \sim N(\hspace{1em}, \hspace{1em})\)
Handout Q14
The model you saw earlier for RFFT was \[Y_i \stackrel{iid}{\sim} N(\mu, \sigma^2)\]
or equivalently,
\[Y_i = \color{blue}{\mu} + \color{red}{\epsilon_i} \quad\text{where}\quad \epsilon_i \stackrel{iid}{\sim} N(0, \sigma^2)\] In other words: \[\text{RFFT} = \text{average} + \text{deviation}\]

For dependent observations, covariance measures how two RVs vary together.
If \(Y_1, Y_2\) are RVs, we define
\[\text{Cov}[Y_1, Y_2] = \mathbb{E}\left[(Y_1 - \mathbb{E}[Y_1])(Y_2 - \mathbb{E}[Y_2])\right]\]
Facts:
For any two random variables \(\color{blue}{Y_1}, \color{red}{Y_2}\) and any constants \(a, b, c\) we have
\[\mathbb{E}\left[a\color{blue}{Y_1} + b\color{red}{Y_2} + c\right] = a\,\mathbb{E}[\color{blue}{Y_1}] + b\,\mathbb{E}[\color{red}{Y_2}] + c\]
and
\[\text{Var}\left[a\color{blue}{Y_1} + b\color{red}{Y_2} + c\right] = a^2\text{Var}[\color{blue}{Y_1}] + b^2\text{Var}[\color{red}{Y_2}] + 2ab\,\text{Cov}[\color{blue}{Y_1}, \color{red}{Y_2}]\]
Note that if \(Y_1, Y_2\) are independent, \(\text{Cov}[Y_1, Y_2] = 0\) and we obtain
\[\text{Var}\left[aY_1 + bY_2 + c\right] = a^2\text{Var}[Y_1] + b^2\text{Var}[Y_2]\]
Handout Q15-16
A random vector is a vector whose entries are random variables:
\[Y = \left[\begin{array}{ccc} Y_1 &\cdots &Y_n\end{array}\right]^T\]
Its mean vector and covariance matrix are defined by \[\mathbb{E}[Y] = \left[\begin{array}{c} \mathbb{E}[Y_1] \\ \vdots \\ \mathbb{E}[Y_n]\end{array}\right] \qquad\text{and}\qquad \text{Var}[Y] = \left\{\text{Cov}[Y_i, Y_j]\right\}\]
Linearity properties entail that for any fixed matrix \(A\) with conformal dimensions, \[\mathbb{E}[AY] = A\,\mathbb{E}[Y] \qquad\text{and}\qquad \text{Var}[AY] = A\,\text{Var}[Y]\,A^T\]
Handout Q17
We can capture the features of the RFFT model in a single line
\[Y = \mu + \epsilon\,, \quad \mathbb{E}[\epsilon] = 0\,, \quad \text{Var}[\epsilon] = \sigma^2 I\] where everything is a vector or matrix:
If we adopt a normal model for the errors, we get the whole thing in a nutshell1 \[Y \sim N(\mu, \sigma^2 I)\]
Now consider the linear regression model \(\text{RFFT}_i = \beta_0 + \beta_1 \text{age}_{i} + \epsilon_i\).
In vector form: \[\left[\begin{array}{c} Y_1 \\ Y_2 \\ \vdots \\ Y_n \end{array}\right] = \beta_0 \left[\begin{array}{c} 1 \\ 1 \\ \vdots \\ 1 \end{array}\right] + \beta_1 \left[\begin{array}{c} x_1 \\ x_2 \\ \vdots \\ x_n \end{array}\right] + \left[\begin{array}{c} \epsilon_1 \\ \epsilon_2 \\ \vdots \\ \epsilon_n \end{array}\right]\]
Notice the linear portion can be written as a matrix product: \[\underbrace{\left[\begin{array}{c} Y_1 \\ Y_2 \\ \vdots \\ Y_n \end{array}\right]}_{Y} = \underbrace{\left[\begin{array}{cc} 1 &x_1 \\ 1 &x_2 \\ \vdots \\ 1 &x_n \end{array}\right] \left[\begin{array}{c} \beta_0 \\ \beta_1 \end{array}\right]}_{X\beta} + \underbrace{\left[\begin{array}{c} \epsilon_1 \\ \epsilon_2 \\ \vdots \\ \epsilon_n \end{array}\right]}_\epsilon\]
Thus, we can write the linear model as:
\[Y = X\beta + \epsilon\,, \quad \mathbb{E}[\epsilon] = 0\,, \quad \text{Var}[\epsilon] = \sigma^2 I\]
where everything is a vector or matrix:
What’s next: estimation