数据分析代写

COMPLETE ALL OF THE FOLLOWING

Directions – for the following, start by using this matrix. Call this matrix M.

 

[1  4  2  4

2  0  0  1

3  2  0  2

4  0  3  3

5  0  0  4

6  3  1  3]

 

The shape of this matrix, M, is 6 rows by 4 columns.

Each vector in this matrix is a column vector. For example, the first vector in M is

[1

2

3

4

5

6]

Each vector in M is 6 by 1, and M is 6 by 4.

 

** ROUND everything that you need to print or show to 3 (three) decimal places  **

 

You will use Python3 for all of the following. YOUR CODE MUST RUN ON SPYDER.

Complete all of the following  – both as code if it requires coding  – and by including any requested items below. All code will go into one (1) Python3 (.py) file. Comment your code to note each question and part.  You will also complete this document and all questions asked – and will submit this document along with your .py program to BlackBoard as noted above. Use MS Word ONLY for this document.

 

Exam Questions:

 

1) Use Python to find the mean column vector of M.

 

(a) What is the mean column vector (type or paste it here)?  ( 5 points)

 

(b) What is the shape of the mean column vector? (2 points)

2) Use Python to create a matrix that is M minus the mean. Call this new matrix A.

Type or paste the new matrix A here – the whole thing. (5 points)

3) Use Python to find the true covariance matrix of A (the whole thing).

Type or paste the covariance matrix for A here. (10 points)

4) Using the covariance matrix from (3) above, use Python to determine the eigenvalues and eigenvectors.

Sort the eigenvalues. Round them to 3 decimal places. Print or paste them all here. (10 points)

5) Sort the eigenvectors (based on the eigenvalues). Round them to 3 decimal places. Print or paste them all here. (10 points)

6) Use Python to calculate Turk and Pentland’s “reduced” covariance matrix (ATA). Paste it here. (10 points)

7) Sort the eigenvalues for the Turk and Pentland reduced covariance matrix. Round them to 3 decimal places. Print or paste them here. (10 points)

8) Sort the eigenvectors (per the eigenvalues) for the Turk and Pentland reduced covariance matrix. Round them to 3 decimal places. Print or paste them here. (10 points)

9) Are the eigenvalues for the regular C=AAT covariance matrix for A the same as the eigenvalues for the reduced Turk&Pentland covariance matrix C’= ATA?  (Choose yes or no and then answer the following…) (15 points) NOTE: This question does not require coding and should be answered here.

 

If yes, use linear algebra to show why this should be. Type the linear algebra proof here and show all needed steps so that I can see that you know what you are talking about.

 

If no, use linear algebra to show why this cannot be. Type the linear algebra proof here and show all needed steps so that I can see that you know what you are talking about.

10) Convert (also known as projection) the largest Turk&Pentland eigenvector from ATA (the eigenvector associated with the largest eigenvalue) back into our original space. (You must determine what this is, what this means, and how to do it). Type/paste the projected eigenvector here. Also, type out the steps of what you did to do this. You will also code this and so it will be in the code under #10. (

13 points)