Professional Documents
Culture Documents
import numpy as np
In [4]:
#Defining Matrix A
A = np.array([[0, 0, 0, 1],
[1, 1, 1, 1],
[4, 2, np.sqrt(2), 1],
[16, 4, 2 ,1],
[4, 2, np.sqrt(2), 1]])
In [5]:
In [8]:
#Compute A Transpose A
ATA = np.matmul(np.transpose(A),A)
In [12]:
#Compute A Transpose b
ATb = np.matmul(np.transpose(A),b)
In [13]:
np.linalg.solve(ATA, ATb)
Out[13]:
In [14]:
In [15]:
/Users/feihuyan/anaconda3/lib/python3.7/site-packages/ipykernel_laun
cher.py:7: RuntimeWarning: invalid value encountered in sqrt
import sys
In [ ]: