Back to Symmetric matrices and variance

Activity 7.1.5

Avg difficulty 2.5

Let's return to the dataset from the previous activity in which we have demeaned data points: d~1=[−1−1],d~2=[0−1],d~3=[12].\dtil_1=\twovec{-1}{-1},\hspace{24pt} \dtil_2=\twovec{0}{-1},\hspace{24pt} \dtil_3=\twovec{1}{2}. Our goal is to compute the variance VuV_{\uvec} in the direction defined by a unit vector u\uvec.

To begin, form the demeaned data matrix A=[d~1d~2d~3]A = \begin{bmatrix} \dtil_1 & \dtil_2 & \dtil_3 \end{bmatrix} and suppose that u\uvec is a unit vector.

  1. Write the vector ATuA^T\uvec in terms of the dot products d~j⋅u\dtil_j\cdot\uvec.

  2. Explain why Vu=13∣ATu∣2V_{\uvec} = \frac13|A^T\uvec|^2.

  3. Apply this proposition to explain why Vu=13∣ATu∣2=13(ATu)⋅(ATu)=uT(13AAT)u=u⋅(13AAT)uV_{\uvec} = \frac13|A^T\uvec|^2 = \frac13 (A^T\uvec)\cdot(A^T\uvec) = \uvec^T\left(\frac13 AA^T\right)\uvec = \uvec\cdot\left(\frac13 AA^T\right)\uvec

  4. In general, the matrix C=1N AATC=\frac1N~AA^T is called the covariance matrix of the dataset, and it is useful because the variance Vu=u⋅(Cu)V_{\uvec} = \uvec\cdot(C\uvec), as we have just seen. Find the matrix CC for our dataset with three points.

  5. Use the covariance matrix to find the variance Vu1V_{\uvec_1} when u1=[1/52/5]\uvec_1=\twovec{1/\sqrt{5}}{2/\sqrt{5}}.

  6. Use the covariance matrix to find the variance Vu2V_{\uvec_2} when u2=[−2/51/5]\uvec_2=\twovec{-2/\sqrt{5}}{1/\sqrt{5}}. Since u1\uvec_1 and u2\uvec_2 are orthogonal, verify that the sum of Vu1V_{\uvec_1} and Vu2V_{\uvec_2} gives the total variance.

  7. Explain why the covariance matrix CC is a symmetric matrix.

Austin, Understanding Linear Algebra, §7.1 Symmetric matrices and variance, Activity 7.1.5

AI Tutor

Adapted from Understanding Linear Algebra © 2023 David Austin. Licensed under CC BY 4.0. Source: Understanding Linear Algebra. Imported at revision 3e6dced.