3.6 Practice Problems
Problem 3.1. For a data matrix \(X\) of \(n\) observations on \(p\) variables, show that \[\overline {\underline {x}} = \tfrac {1}{n}X'\underline {1}, \qquad S = \tfrac {1}{n-1}X'HX,\] where \(H\) is the centring matrix. Where to start: \(HX\) has the column means subtracted from every entry.
Problem 3.2. The generalised variance is \(\left |S\right |\) and the total variance is \(\operatorname {tr}(S)\). Compute both for \(S = \begin {pmatrix} 4 & 3\\ 3 & 4\end {pmatrix}\) and for \(S = \begin {pmatrix} 4 & 0\\ 0 & 4\end {pmatrix}\). The total variance is the same in each; explain what the generalised variance detects that it does not.
Show solution
Solution. The traces are both \(8\). The determinants are \(16-9=7\) and \(16\).
The generalised variance measures the volume occupied by the data, and correlation collapses that volume: in the first case the observations lie close to a line, so the ellipse of Section 4 is thin and its area small, while in the second the variables are uncorrelated and the ellipse is a circle of the same total spread. The trace sees only the sum of the axes and cannot tell these apart. In the limit of perfect correlation \(|S|=0\), and the data lie exactly on a line.
Problem 3.3. Show that \(\left |S\right | = \prod ^{p}_{i=1}\lambda _i\) where the \(\lambda _i\) are the eigenvalues of \(S\), and hence that a zero generalised variance means at least one exact linear relation among the variables.
Problem 3.4. Data are recorded on height in centimetres and mass in kilogrammes. State what happens to \(\overline {\underline {x}}\), \(S\), \(R\), \(\operatorname {tr}(S)\) and \(\left |S\right |\) if height is re-expressed in metres. Which of these are invariant, and why does the answer matter for Section 4.3?
Problem 3.5. Show that the sample correlation between two variables is unchanged by any linear rescaling \(x\mapsto ax+b\) with \(a>0\), and reverses sign if \(a<0\).
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.