I have a system of equations that I am trying to solve. In matrix form, it's written as

$$x(I - S) = b.$$

I am solving for $x$, where $I$ is the identity matrix and $S$ is a matrix where each column sums up to one. $b$ is strictly positive.

Now, unfortunately, the determinant of $I - S$ is very small. Inverting it leads to a matrix that is huge everywhere, and even numpy.linalg.solve comes up with a solution for $x$ that is huge (every element around e+19). What is an alternative way of solving this? The matrix itself is not large, there are around 30-50 elements in $x$.

  • 1
    $\begingroup$ I don't know, but maybe some regularization method could be useful. $\endgroup$ – VoB Apr 7 at 13:37
  • $\begingroup$ Usually SVD helps for such situations $\endgroup$ – Maxim Umansky Apr 8 at 18:24

You cannot solve what has no solutions

That matrix is singular, so the system has either zero or infinite solutions. In the case of your system, I think some Perron-Frobenius theory can be used to prove that there are zero: there is a non-negative vector such that $Sv=v$, hence $0=x(I-S)v=bv > 0$, contradiction. (Those $x$ and $b$ are row vectors, right?)

| cite | improve this answer | |
  • $\begingroup$ $x$ and $b$ are column vectors $\endgroup$ – FooBar Apr 7 at 14:39
  • 3
    $\begingroup$ Note that you can't multiply a column vector $x$ by $(I-S)$. You could write this as $x^{T}(I-S)=b^{T}$ if $x$ and $b$ are to be column vectors. $\endgroup$ – Brian Borchers Apr 7 at 15:38
  • $\begingroup$ Yeah sorry, my bad. I was tired when answering this. For the sake of this system they are row vectors. $\endgroup$ – FooBar Apr 7 at 16:22
  • 2
    $\begingroup$ If you change the question I can edit the answer accordingly. Anyway, the algebra is slightly different, but all claims here still hold if $x,b$ are column vectors: your system has no solution. $\endgroup$ – Federico Poloni Apr 7 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.