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 Write a function that accepts a matrix A and a positive integer
Use your function from Problem or scipy.linalg.svd to compute the compact SVD
of then form the truncated SVD by stripping off the appropriate columns and entries
from and Return the best rank approximation of with respect to the
induced norm and Frobenius norm
Also return the number of entries required to store the truncated form widehatwhere widehat
is stored as a onedimensional array, not the full diagonal matrix The number of entries
stored in NumPy array can be accessed by its size attribute.
If is greater than the number of nonzero singular values of meaning rank
raise a ValueError.
Use linalg.matrixrank to verify the rank of your approximation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
