The row space of this matrix has no vectors $≥ 0$. Why?

85 Views Asked by At

I have this matrix:

$$A = \begin{pmatrix} 0 & 0 & 3.143 & 0 & -1 \\ 0 & 0.25 & 0.524 & -1.25 & 0.5 \\ 0 & 0.75 & -0.476 & 0 & 0.25 \\ 3 & 0 & -0.952 & 0 & -2 \\ -4 & 0 & 0 & 0 & 1 \\ 1 & 0 & -3.81 & 0 & -3 \\ 0 & 0 & 0 & -2.75 & 2.75 \\ 2 & 0 & 1.571 & 0 & -1.5 \\ -2 & -1 & 0 & 4 & 3 \end{pmatrix}$$

I used scipy.linalg.null_space(A, rcond=100) to find all the vectors approximately perpendicular to the rows of $A$. In other words, I tried to solve $Ax \approx 0$.

The result is this (each column is a solution):

$$X = \begin{pmatrix} -0.663993 & -0.214224 & 0.189817 & 0.689689 & 0.038987 \\ -0.070814 & -0.082310 & -0.114650 & -0.117610 & 0.980425 \\ 0.235034 & -0.797450 & 0.530030 & -0.166841 & -0.008005 \\ 0.227433 & 0.543618 & 0.771790 & 0.165666 & 0.172191 \\ 0.668679 & -0.126040 & -0.272459 & 0.674697 & 0.086790 \end{pmatrix} $$

Each row of $A$ has at least one positive and one negative element, so I was expecting to get at least a solution with uniform sign (all elements non negative or non positive). This was the case for a lot of other matrices I had, but this one is an exception which baffles me.

My geometric intuition is that if I have a bunch of vectors $v_i$ such that all avoid the regions $v_i \ge 0$ and $v_i \le 0$, then there has to be an "approximate perpendicular" to all of them lying in the positive (or negative) "quadrant". This intuition works for 2D and 3D. Is it not valid for nD?

Note: The column sums of $A$ are all $0$. In other words, the average of all its rows is the origin.

The vectors returned by scipy.linalg.null_space() are orthonormal. Do I have to try some linear combination of them to get the solution $x \ge 0$? How do I find this linear combination? Is it guaranteed to exist?

Any help much appreciated.

PS: This is not homework. I encountered this situation while modelling something in economy.

1

There are 1 best solutions below

1
On

Consider a singular matrix $A$ with real elements.

My geometric intuition is that if I have a bunch of vectors $v_i$ such that all avoid the regions $v_i \ge 0$ and $v_i \le 0$, then there has to be an "approximate perpendicular" to all of them lying in the positive (or negative) "quadrant". This intuition works for 2D and 3D. Is it not valid for nD?

No. Your intuition already fails in the 3D case. E.g. every row of $$ A =\pmatrix{ 1&-1& 0\\ -4& 2&-4\\ 3&-1& 4} $$ has a pair of elements of different signs, but $\ker(A)$ is spanned by $(2,2,-1)^T$, which is not a nonnegative/nonpositive vector.

What you need is not just a bunch of vectors that evades the first orthant and its negative, but a row space of codimension $1$ that evades the first orthant.

Suppose the row space of $A$ has codimension 1 and it does not contain any nonnegative vector except $0$, then its orthogonal complement, which is $\ker(A)$, is spanned by some nonzero vector $p$. If $p$ has a pair of elements of different signs, say, if $p_1p_2<0$, then $q^Tp=0$ when $q^T=(\frac{1}{|p_1|},\frac{1}{|p_2|},0,\ldots,0)$ and in turn, $q\ne0$ is a nonnegative vector that lies inside $\ker(A)^\perp=$ the row space of $A$, which is a contradiction. Therefore $p$ must be nonnegative or nonpositive and so are all vectors in $\ker(A)$.

In contrast, suppose the row space of $A$ contains some positive vector $p^T$ (for instance, in the example above, we have $(-5,1,4)A=(3,3,12)>0$ entrywise). Since $p^Tx>0$ for every nonnegative but nonzero vector $x$, any vector that is normal to the row space of $A$, i.e., those vectors in $\ker(A)$, must either be zero or contain a pair of elements of different signs.