Homepage › Solution manuals › Gilbert Strang › Linear Algebra and Learning from Data › Exercise 1.1.24
Exercise 1.1.24
Create a by matrix with rank . Factor into . The reason for this page is that the factorizations and have jumped forward in importance for large matrices. When takes columns directly from , and takes rows directly from , those matrices preserve properties that are lost in the more famous and SVD factorizations. Where and involve orthogonalizing the vectors, and keep the original data:
- If is nonnegative, so are and .
- If is sparse, so are and .
Answers
We pick , then we have
Pick , so we have
import numpy as np R = np.array([[1, 3], [2,5]])#.reshape(1,2) A = np.array([[1,3],[2,5],[3,6]]) C = A a = np.matmul(C.transpose(), A) b = np.matmul(a, R.transpose()) k = np.matmul(C.transpose(), C) invc = np.linalg.inv(k) invr = np.linalg.inv(np.matmul(R, R.transpose())) m = np.matmul(a, b) f = np.matmul(invc, m) f = np.matmul(f, invr) invc, invr, m, f
(array([[ 3.68421053, -1.63157895], [-1.63157895, 0.73684211]]), array([[ 29., -17.], [-17., 10.]]), array([[ 8969, 15334], [20187, 34513]]), array([[ -8., 11.], [-15., 23.]]))