Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your problem is not too large, you can solve it by solving an equivalent linear system. Suppose you write your constrained least-squares problem in the form</p> <pre><code>min 1/2 |Ax - b|^2 subject to Bx = c, </code></pre> <p>in the Euclidian norm (it really sucks that StackOverflow doesn't support MathJax!) The factor 1/2 is just there for convenience. The solution x to the above problem (assuming there is one) can equivalently be found by solving the linear system</p> <pre><code>[ I A 0 ] [ r ] [ b ] [ A.T 0 B.T ] [ x ] = [ 0 ] [ 0 B 0 ] [ y ] [ c ] </code></pre> <p>where the zero blocks have appropriate sizes, <code>.T</code> indicates transposition and <code>I</code> is the identity matrix of appropriate size. You're looking for the middle segment of the solution vector. Note that the above matrix is symmetric but it's indefinite so if you don't have anything specialized, you'll have to use the LU factorization to solve the system (it's OK but you could save about half of the work.) You can't use Cholesky.</p> <p>If your problem is large, you can also use <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.minres.html#scipy.sparse.linalg.minres" rel="nofollow">MINRES</a> to solve the above system without actually assembling or factorizing it. You'll only need to provide a <code>LinearOperator</code> that computes products with this matrix.</p> <p>I also discovered: <a href="https://gist.github.com/fabianp/915461" rel="nofollow">https://gist.github.com/fabianp/915461</a> (but haven't tested).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload