3

Following the example on L1 norm approximation given here, with the following code,

from l1 import l1
from cvxopt import normal

m, n = 500, 100
P, q = normal(m,n), normal(m,1) 
u = l1(P,q)

everything works okay.

However when I change m to be smaller than n,

from l1 import l1
from cvxopt import normal

m, n = 50, 100
P, q = normal(m,n), normal(m,1) 
u = l1(P,q)

I get the following error:

ValueError: illegal value of ldB

I can see that the error is caused by the following statement in L1.py:180:

lapack.gels(+P, uls)

and diving further down into lapack.c:3651, the following statement throws the error:

if (ldB < MAX(MAX(1,n),m)) err_ld("ldB");

However, when I read the documentation on CVXOPT's LAPACK interface for cvxopt.lapack.gels, it specifically says, that when m is less than n, it solves a least norm problem.

Can anyone shed some light on why having m smaller than n does not work?

1 Answers1

0

I had this same question and for posterity am adding an answer I found from the CVXOPT issues. It seems that the l1 function is used strictly for approximating ||Ax - b||_1 in the overdetermined case. I suppose "approximating" is supposed to be the keyword indicating "overdetermined" but that wasn't clear to me. Anyway, Martin Anderson says:

Notice that the optimal value is zero when m < n and the equation Ax = b is consistent. This implies that any solution to the underdetermined system Ax = b is also a solution to the optimization problem. The l1 example code is intended for the case when m > n.

jjjjjj
  • 1,152
  • 1
  • 14
  • 30