Homework 2

Calculate the square root of a covariance matrix.

Let S be a sample variance covariance matrix.

1.    Calculate the eigenvalue decomposition of S using the function eigen().


2.    Calculate the symmetric square root matrix R using the eigenvalue decomposition of S. Verify the identity S = R2.


3.    Use the function chol to calculate the cholesky decomposition matrix A, and verify the identity S=AกฏA.


4.    Draw a circle of center  and radius 1, C(z,1), by connecting n points. 


5.    Transform the points that make the circle C(z,1)  into an ellipse of center z and shape S E(z,S) and draw it.


6.    Generate a sample X of 50 observations from a normal population with mean z and variance covariance matrix S.


7.    Calculate the sample mean and sample covariance matrix of X and draw a 95% confidence ellipse region for the population mean.