Post Reply 
Not returning correct Matrix Calculation
04-27-2021, 08:09 PM
Post: #2
RE: Not returning correct Matrix Calculation
Hi, Amer7

Tried this in Numpy, Excel numbers were wrong.

>>> from numpy import *
>>> A = array([
... [2568.0000, -2568.00 , 1, 0],
... [2568.0000, 2568.00000, 0, 1],
... [3852.1284, -2568.00 , 1, 0],
... [2568.0000, 3852.12840, 0, 1],
... [3536.9834, -3411.36 , 1, 0],
... [3411.3569, 3536.98344, 0, 1]])
>>> B = dot(transpose(A), A)
Code:
>>> print B
[[  5.87703727e+07  -1.08281943e+01   9.95711180e+03   8.54735690e+03]
 [ -1.08281943e+01   5.87703941e+07  -8.54736000e+03   9.95711184e+03]
 [  9.95711180e+03  -8.54736000e+03   3.00000000e+00   0.00000000e+00]
 [  8.54735690e+03   9.95711184e+03   0.00000000e+00   3.00000000e+00]]
>>> print linalg.inv(B)
[[  7.29974488e-07   3.48034952e-13  -2.42281154e-03  -2.07978531e-03]
 [  3.48034952e-13   7.29972621e-07   2.07977844e-03  -2.42280733e-03]
 [ -2.42281154e-03   2.07977844e-03   1.43002735e+01   1.61304069e-05]
 [ -2.07978531e-03  -2.42280733e-03   1.61304069e-05   1.43002770e+01]]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Not returning correct Matrix Calculation - Albert Chan - 04-27-2021 08:09 PM



User(s) browsing this thread: 1 Guest(s)