# [Numpy-discussion] question on differential results in windows and debian

meng at are.berkeley.edu meng at are.berkeley.edu
Tue Oct 11 14:14:22 CDT 2005

```Hi there-

I have a matrix X, calculate cX=matrixmultiply(transpose(X), X) and finally
invert it by icX = linear_algebra.inverse(cX)
cX is kind of ill-conditioned, which caused the icX differs a lot between
windows and debian, after a tiny difference on cX across platforms. Here
are the results:
In windows:
>>> x.min()
-0.51187150837988826
>>> x.max()
0.81517690875232773
>>> cX = matrixmultiply(transpose(x), x)
>>> cX.min()
-666.96857541904126
>>> cX.max()
1073.3945530725441
>>> import numarray.linear_algebra as la
>>> icX = la.inverse(cX)
>>> icX.min()
-3287030277.3580685
>>> icX.max()
0.0

In debian:
>>> x.min()
-0.51187150837988826
>>> x.max()
0.81517690875232773
>>> cX = matrixmultiply(transpose(x), x)
>>> cX.min()
-666.96857541898294
>>> cX.max()
1073.3945530726264
>>> import numarray.linear_algebra as la
>>> icX = la.inverse(cX)
>>> icX.min()
0.0
>>> icX.max()
84778028554.337051

I don't understand why a multiplication of a matrix and its transpose will
create a tiny difference across windows and debian, which could be
disastrous when inverting it.
numarray 1.3.2 in both machines.

Best,
Xiangyi

Xiangyi Meng
Department of Agricultural and Resource Economics
Room 303, Giannini Hall #3310
University of California, Berkeley
Berkeley, CA 94720-3310
Tel:  (510) 643-4124
Fax: (510) 643-8911
Email: meng at are.berkeley.edu

```