Use MATLAB to solve the following 3-part question.
1. Consider a two-dimensional real and zero-mean Gaussian random vector x = [1,2]T whose correlation matrix is
0.9 0.9
0.9 11
Find the Cholesky factorization in the form R = LLT. Then generate a 2x10000 matrix v using a Normal (Gaussian) random number generator (such as the MATLAB function RandN(2,10000)). Now generate the 10,000 realizations of x using Lv. Calculate the principal vectors of R and display all the elements of x and the two principal vectors in a two-dimensional plot similar to figure 6.1 of the notes. Next, calculate an estimate of the true correlation matrix R from the generated data using R = xxT and calculate the principal vectors of R and plot them too.
2. Calculate the transformed data y = WTx and plot y1 vs y2, where W is the matrix whose columns are the principal eigenvectors ordered from lowest to greatest eigenvalue. Next, zero out the column of W corresponding to the smallest eigenvalue and then calculate the compressed data y = wf'x where w1 is the (first) principal eigenvector: this single data set is responsible for the largest variation in the original 2x10000 set.