December 2017
Intermediate to advanced
386 pages
10h 42m
English
QR decomposition can be done by using the qr function within scipy.linalg.
In the following code, let us look into how QR decomposition works:
import scipy.linalg as linalgimport numpy as np
A = np.array([ [2., 1., 1.], [1., 3., 2.], [1., 0., 0]])
Q, R = linalg.qr(A)
print(Q)[[-0.81649658 0.27602622 -0.50709255][-0.40824829 -0.89708523 0.16903085][-0.40824829 0.34503278 0.84515425]] print(R)[[-2.44948974 -2.04124145 -1.63299316][ 0. -2.41522946 -1.51814423][ 0. 0. -0.16903085]]
Once we have the results, let us look into the preceding properties mentioned.
Read now
Unlock full access