Question: 4.1 Covariance Matrix 1. Write a function to generate n random symmetric and positive (semi) definite matrices (i.e., covariance matrices) of size (p:p) Hint 1.

 4.1 Covariance Matrix 1. Write a function to generate n random

4.1 Covariance Matrix 1. Write a function to generate n random symmetric and positive (semi) definite matrices (i.e., covariance matrices) of size (p:p) Hint 1. Use numpy package np.random to generate random matrix A Hint 2. S = A'A is a symmetric and positive matrix 2. Use the function to generate n=20 positive definite matrices of size (10x10) in a loop and at each loop compute the variance of the equally weighted portfolio of 10 assets (weight 1/10 invested in each asset) Note: The Variance-Covariance Matrix (E) is defined as the following It is a symmetric matrix it is positive semidefinite (You can check positive semidefinitiveness if all eigenvalues of the matrix are positive or zero or the determinant of all principal submatrices is positive or zero. The covariance matrix can be written as = A'DA, where A is a random matrix and D is a diagonal matrix with positive diagonal elements. Therefore, to generate random covariance matrices, you can generate random A and D. Also, for any matrix A. I = A'I A = A'A is also a covariance matrix 4.1 Covariance Matrix 1. Write a function to generate n random symmetric and positive (semi) definite matrices (i.e., covariance matrices) of size (p:p) Hint 1. Use numpy package np.random to generate random matrix A Hint 2. S = A'A is a symmetric and positive matrix 2. Use the function to generate n=20 positive definite matrices of size (10x10) in a loop and at each loop compute the variance of the equally weighted portfolio of 10 assets (weight 1/10 invested in each asset) Note: The Variance-Covariance Matrix (E) is defined as the following It is a symmetric matrix it is positive semidefinite (You can check positive semidefinitiveness if all eigenvalues of the matrix are positive or zero or the determinant of all principal submatrices is positive or zero. The covariance matrix can be written as = A'DA, where A is a random matrix and D is a diagonal matrix with positive diagonal elements. Therefore, to generate random covariance matrices, you can generate random A and D. Also, for any matrix A. I = A'I A = A'A is also a covariance matrix

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!