Question: Problem 3 . Write a function that accepts a matrix A and a positive integer s . Use your function from Problem 1 or scipy.linalg.svd

Problem 3. Write a function that accepts a matrix A and a positive integer s.
Use your function from Problem 1 or scipy.linalg.svd() to compute the compact SVD
of A, then form the truncated SVD by stripping off the appropriate columns and entries
from U1,1, and V1. Return the best rank s approximation As of A(with respect to the
induced 2-norm and Frobenius norm).
Also return the number of entries required to store the truncated form widehat(U)widehat()widehat(V)H(where widehat()
is stored as a one-dimensional array, not the full diagonal matrix). The number of entries
stored in NumPy array can be accessed by its size attribute.
If s is greater than the number of nonzero singular values of A(meaning s>rank(A)),
raise a ValueError.
Use np.linalg.matrix_rank() to verify the rank of your approximation.
 Problem 3. Write a function that accepts a matrix A and

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 Databases Questions!