While reviewing the basics of ordinary least squares (OLS) regression in a matrix context, I stumbled upon the variance covariance matrix of the residuals. In an OLS context, the population model is usually assumed to be (for a cross-section of data):
$ \begin{aligned} & y_i = \textbf{x}_i' \beta + u_i. \end{aligned} $
$y$ is then an n$\times$1 vector with the dependent variable, $\textbf{X}$ is an n$\times$k matrix of exogenous variables and $u$ is the n$\times$1 vector of residuals. In order to derive the distribution of the OLS estimator, the following proposition about the residuals is made by Cameron & Trivedi:
Proposition: Data are independent over $i$ with $\text{E}\left({\textbf{u}|\textbf{X}}\right) = \textbf{0} $ and $\text{E}\left({\textbf{uu'}|\textbf{X}}\right) = \bf{\Omega}$$ = $ $\text {Diag}\left({\sigma_i^2}\right)$
Cameron, Trivedi (2005): p. 73
So far, I only ever thought about homoskedasticity, which implies that $\text{E}(u^2) = \sigma^2$. But Cameron & Trivedi make their proposition more general, in that they also allow for heteroskedastic errors with variance $\sigma_i^2$ for different $i$. I knew the concepts of homoskedasticity and heteroskedasticity before, but the way that Cameron & Trivedi frame this proposition makes you think about the distribution of the errors in a matrix way. Clearly, $\bf{\Omega}$ is an $n \times n$ matrix, but when I thought about it, I had troubles understanding the single entries in this variance covariance matrix.
Looking at the diagonal elements of $\bf{\Omega}$: How does $u_1$, for instance, have a variance? We are in a cross-sectional setting, so $u_1$ is essentially one observation point. So how do I obtain the variance for a variable with one observation? The same goes for the off-diagonal elements: How come there exists a covariance for 2 single observations?
Note:
The source is:
Cameron, Trivedi (2005): Microeconometris: Methods and Applications.